Advanced Multi-Physics (AMP)
On-Line Documentation
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
AMP::Geometry::LogicalGeometry Class Referenceabstract

A class used to abstract away logical geometry based operations. More...

#include <LogicalGeometry.h>

Inheritance diagram for AMP::Geometry::LogicalGeometry:
Inheritance graph
[legend]

Public Member Functions

virtual std::pair< Point, Pointbox () const =0
 Return the bounding box.
 
virtual Point centroid () const =0
 Return the centroid.
 
virtual std::unique_ptr< AMP::Geometry::Geometryclone () const =0
 Clone the object.
 
virtual void displace (const double *x)=0
 Displace the entire geometry.
 
virtual double distance (const Point &pos, const Point &dir) const =0
 Calculate the distance to the object given a ray.
 
uint8_t getDim () const
 Get the number of dimensions for the object.
 
AMP::Mesh::GeomType getGeomType () const override final
 Get the geometric type for the geometry.
 
virtual uint64_t getID () const
 Return a unique hash id.
 
uint8_t getLogicalDim () const
 Return the number of logical dimensions.
 
virtual ArraySize getLogicalGridSize (const ArraySize &x) const =0
 Return the logical grid size.
 
virtual ArraySize getLogicalGridSize (const std::vector< double > &res) const =0
 Return the logical grid size.
 
const auto & getLogicalSurfaceIds () const
 Return the surface ids for the logical boundaries.
 
virtual std::string getName () const =0
 Get the name of the geometry.
 
std::array< bool, 3 > getPeriodicDim () const
 Return the logical grid periodic dimensions.
 
virtual bool inside (const Point &pos) const =0
 Is the point in the geometry.
 
virtual bool isConvex () const =0
 Is the object convex.
 
virtual Point logical (const Point &x) const =0
 Return the logical position.
 
 LogicalGeometry (int64_t fid)
 
virtual Point nearest (const Point &pos) const =0
 Calculate the nearest point on the surface.
 
virtual int NSurface () const =0
 Get the number of surfaces.
 
bool operator!= (const Geometry &rhs) const
 Check if two geometries are not equal.
 
virtual bool operator== (const Geometry &rhs) const =0
 Check if two geometries are equal.
 
virtual Point physical (const Point &x) const =0
 Return the physical position.
 
virtual void registerChildObjects (AMP::IO::RestartManager *manager) const
 Register child objects.
 
virtual int surface (const Point &x) const =0
 Get the surface id.
 
virtual Point surfaceNorm (const Point &x) const =0
 Return the outward normal to a surface.
 
virtual double volume () const =0
 Return the volume.
 
void writeRestart (int64_t fid) const override
 Write restart data to file.
 
virtual ~LogicalGeometry ()=default
 Destructor.
 

Static Public Member Functions

static std::shared_ptr< AMP::Geometry::GeometrybuildGeometry (std::shared_ptr< const AMP::Database > db)
 Create a geometry.
 

Protected Member Functions

 LogicalGeometry (const LogicalGeometry &)=default
 
 LogicalGeometry (int physical, int logical, const std::array< int, 6 > &ids={ 1, 2, 3, 4, 5, 6 })
 Default constructor for the base class.
 
 LogicalGeometry (LogicalGeometry &&)=delete
 
LogicalGeometryoperator= (const LogicalGeometry &)=delete
 
LogicalGeometryoperator= (LogicalGeometry &&)=delete
 

Protected Attributes

const std::array< int, 6 > d_ids
 
const uint8_t d_logicalDim
 
const uint8_t d_physicalDim
 

Detailed Description

A class used to abstract away logical geometry based operations.

This class provides routines for reading, accessing and writing logical geometries.

Definition at line 16 of file LogicalGeometry.h.

Constructor & Destructor Documentation

◆ ~LogicalGeometry()

virtual AMP::Geometry::LogicalGeometry::~LogicalGeometry ( )
virtualdefault

Destructor.

◆ LogicalGeometry() [1/4]

AMP::Geometry::LogicalGeometry::LogicalGeometry ( int64_t  fid)

◆ LogicalGeometry() [2/4]

AMP::Geometry::LogicalGeometry::LogicalGeometry ( int  physical,
int  logical,
const std::array< int, 6 > &  ids = { 1, 2, 3, 4, 5, 6 } 
)
protected

Default constructor for the base class.

◆ LogicalGeometry() [3/4]

AMP::Geometry::LogicalGeometry::LogicalGeometry ( LogicalGeometry &&  )
protecteddelete

◆ LogicalGeometry() [4/4]

AMP::Geometry::LogicalGeometry::LogicalGeometry ( const LogicalGeometry )
protecteddefault

Member Function Documentation

◆ box()

virtual std::pair< Point, Point > AMP::Geometry::Geometry::box ( ) const
pure virtualinherited

◆ buildGeometry()

static std::shared_ptr< AMP::Geometry::Geometry > AMP::Geometry::Geometry::buildGeometry ( std::shared_ptr< const AMP::Database db)
staticinherited

Create a geometry.

This function will create a geometry based on the input database.

Parameters
[in]dbParameters for constructing a geometry from an input database

◆ centroid()

virtual Point AMP::Geometry::Geometry::centroid ( ) const
pure virtualinherited

◆ clone()

virtual std::unique_ptr< AMP::Geometry::Geometry > AMP::Geometry::Geometry::clone ( ) const
pure virtualinherited

◆ displace()

virtual void AMP::Geometry::Geometry::displace ( const double *  x)
pure virtualinherited

◆ distance()

virtual double AMP::Geometry::Geometry::distance ( const Point pos,
const Point dir 
) const
pure virtualinherited

Calculate the distance to the object given a ray.

This function computes the distance to the object given a ray. If the ray is inside the object, this distance is negitive. If the ray will never intersect the object, this distance is inf.

Parameters
[in]posCurrent position of ray
[in]dirDirection of ray (should be normalized for most uses)
Returns
Returns the distance to the nearest surface (intersection = pos + dir*distance)

Implemented in AMP::Geometry::MeshGeometry, AMP::Geometry::MultiGeometry, AMP::Geometry::Box< NDIM >, AMP::Geometry::Circle, AMP::Geometry::CircleFrustum, AMP::Geometry::CircleSurface, AMP::Geometry::Cylinder, AMP::Geometry::Parallelepiped, AMP::Geometry::RegularPolygon, AMP::Geometry::Shell, AMP::Geometry::Sphere, AMP::Geometry::SphereSurface, AMP::Geometry::SquareFrustum, AMP::Geometry::Tube, and AMP::Geometry::RotationalGeometry.

◆ getDim()

uint8_t AMP::Geometry::Geometry::getDim ( ) const
inlineinherited

Get the number of dimensions for the object.

This function returns the number of physical dimensions for the geometry

Returns
Returns the number of physical dimensions

Definition at line 42 of file Geometry.h.

References AMP::Geometry::Geometry::d_physicalDim.

◆ getGeomType()

AMP::Mesh::GeomType AMP::Geometry::LogicalGeometry::getGeomType ( ) const
finaloverridevirtual

Get the geometric type for the geometry.

This function returns the largest geometric type supported by the geometry

Returns
Returns the geometric dimensions

Reimplemented from AMP::Geometry::Geometry.

◆ getID()

virtual uint64_t AMP::Geometry::Geometry::getID ( ) const
virtualinherited

Return a unique hash id.

◆ getLogicalDim()

uint8_t AMP::Geometry::LogicalGeometry::getLogicalDim ( ) const
inline

Return the number of logical dimensions.

This function will return the number of logical dimensions of the underlying geometry. If the geometry is not logically rectangular this function should return 0.

Definition at line 44 of file LogicalGeometry.h.

References d_logicalDim.

◆ getLogicalGridSize() [1/2]

virtual ArraySize AMP::Geometry::LogicalGeometry::getLogicalGridSize ( const ArraySize x) const
pure virtual

Return the logical grid size.

This function will return the dimensions of a logical grid given a size that makes sense for the object.

Parameters
[in]xInput size
Returns
Return the logical grid size

Implemented in AMP::Geometry::Box< NDIM >, AMP::Geometry::Circle, AMP::Geometry::CircleFrustum, AMP::Geometry::CircleSurface, AMP::Geometry::Cylinder, AMP::Geometry::Parallelepiped, AMP::Geometry::RegularPolygon, AMP::Geometry::Shell, AMP::Geometry::Sphere, AMP::Geometry::SphereSurface, AMP::Geometry::SquareFrustum, and AMP::Geometry::Tube.

◆ getLogicalGridSize() [2/2]

virtual ArraySize AMP::Geometry::LogicalGeometry::getLogicalGridSize ( const std::vector< double > &  res) const
pure virtual

Return the logical grid size.

This function will return the dimensions of a logical grid given a desired resolution

Parameters
[in]resDesired resolution
Returns
Return the logical grid size

Implemented in AMP::Geometry::RotationalGeometry, AMP::Geometry::Box< NDIM >, AMP::Geometry::Circle, AMP::Geometry::CircleFrustum, AMP::Geometry::CircleSurface, AMP::Geometry::Cylinder, AMP::Geometry::Parallelepiped, AMP::Geometry::RegularPolygon, AMP::Geometry::Shell, AMP::Geometry::Sphere, AMP::Geometry::SphereSurface, AMP::Geometry::SquareFrustum, and AMP::Geometry::Tube.

◆ getLogicalSurfaceIds()

const auto & AMP::Geometry::LogicalGeometry::getLogicalSurfaceIds ( ) const
inline

Return the surface ids for the logical boundaries.

This function will return the surface ids for each logical boundary. If a logical boundary is periodic, it will return -1. If a logical boundary maps to another point on the boundary, it will return -2. If a logical boundary is not periodic, is not physical, and does not map to another point on the boundary (i.e. unused dimensions), it will return -3. Note: The returned array may be larger than the number of dimensions

Returns
Return the logical boundary ids (2*logicalDim)

Definition at line 83 of file LogicalGeometry.h.

References d_ids.

◆ getName()

virtual std::string AMP::Geometry::Geometry::getName ( ) const
pure virtualinherited

◆ getPeriodicDim()

std::array< bool, 3 > AMP::Geometry::LogicalGeometry::getPeriodicDim ( ) const

Return the logical grid periodic dimensions.

This function will return a vector indicating which logical grid dimensions are periodic. Note: The returned array may be larger than the number of dimensions

Returns
Return the periodic dimensions

◆ inside()

virtual bool AMP::Geometry::Geometry::inside ( const Point pos) const
pure virtualinherited

Is the point in the geometry.

This function checks if the ray is in the geometry. If it is on the surface, it will return true.

Parameters
[in]posCurrent position
Returns
Returns true if the point is inside the geometry (or on the surface)

Implemented in AMP::Geometry::MeshGeometry, AMP::Geometry::MultiGeometry, AMP::Geometry::Box< NDIM >, AMP::Geometry::Circle, AMP::Geometry::CircleFrustum, AMP::Geometry::CircleSurface, AMP::Geometry::Cylinder, AMP::Geometry::Parallelepiped, AMP::Geometry::RegularPolygon, AMP::Geometry::Shell, AMP::Geometry::Sphere, AMP::Geometry::SphereSurface, AMP::Geometry::SquareFrustum, AMP::Geometry::Tube, and AMP::Geometry::RotationalGeometry.

◆ isConvex()

virtual bool AMP::Geometry::Geometry::isConvex ( ) const
pure virtualinherited

◆ logical()

virtual Point AMP::Geometry::LogicalGeometry::logical ( const Point x) const
pure virtual

Return the logical position.

This function will return logical coordinate given the physical coordinates

Parameters
[in]xPhysical coordinate of the point
Returns
Returns the logical coordinates

Implemented in AMP::Geometry::RotationalGeometry, AMP::Geometry::Box< NDIM >, AMP::Geometry::Grid< NDIM >, AMP::Geometry::Circle, AMP::Geometry::CircleFrustum, AMP::Geometry::CircleSurface, AMP::Geometry::Cylinder, AMP::Geometry::Parallelepiped, AMP::Geometry::RegularPolygon, AMP::Geometry::Shell, AMP::Geometry::Sphere, AMP::Geometry::SphereSurface, AMP::Geometry::SquareFrustum, and AMP::Geometry::Tube.

◆ nearest()

virtual Point AMP::Geometry::Geometry::nearest ( const Point pos) const
pure virtualinherited

◆ NSurface()

virtual int AMP::Geometry::Geometry::NSurface ( ) const
pure virtualinherited

◆ operator!=()

bool AMP::Geometry::Geometry::operator!= ( const Geometry rhs) const
inlineinherited

Check if two geometries are not equal.

Definition at line 151 of file Geometry.h.

References AMP::Geometry::Geometry::operator==().

◆ operator=() [1/2]

LogicalGeometry & AMP::Geometry::LogicalGeometry::operator= ( const LogicalGeometry )
protecteddelete

◆ operator=() [2/2]

LogicalGeometry & AMP::Geometry::LogicalGeometry::operator= ( LogicalGeometry &&  )
protecteddelete

◆ operator==()

virtual bool AMP::Geometry::Geometry::operator== ( const Geometry rhs) const
pure virtualinherited

◆ physical()

virtual Point AMP::Geometry::LogicalGeometry::physical ( const Point x) const
pure virtual

Return the physical position.

This function will return physical coordinate given the logical coordinates

Parameters
[in]xLogical coordinate of the point
Returns
Returns the physical coordinates

Implemented in AMP::Geometry::Box< NDIM >, AMP::Geometry::RotationalGeometry, AMP::Geometry::Grid< NDIM >, AMP::Geometry::Circle, AMP::Geometry::CircleFrustum, AMP::Geometry::CircleSurface, AMP::Geometry::Cylinder, AMP::Geometry::Parallelepiped, AMP::Geometry::RegularPolygon, AMP::Geometry::Shell, AMP::Geometry::Sphere, AMP::Geometry::SphereSurface, AMP::Geometry::SquareFrustum, and AMP::Geometry::Tube.

◆ registerChildObjects()

virtual void AMP::Geometry::Geometry::registerChildObjects ( AMP::IO::RestartManager manager) const
virtualinherited

Register child objects.

This function register child objects if necessary

Parameters
managerRestart manager

Reimplemented in AMP::Geometry::MultiGeometry.

◆ surface()

virtual int AMP::Geometry::Geometry::surface ( const Point x) const
pure virtualinherited

◆ surfaceNorm()

virtual Point AMP::Geometry::Geometry::surfaceNorm ( const Point x) const
pure virtualinherited

◆ volume()

virtual double AMP::Geometry::Geometry::volume ( ) const
pure virtualinherited

◆ writeRestart()

void AMP::Geometry::LogicalGeometry::writeRestart ( int64_t  fid) const
overridevirtual

Write restart data to file.

This function will write the mesh to an HDF5 file

Parameters
fidFile identifier to write

Reimplemented from AMP::Geometry::Geometry.

Reimplemented in AMP::Geometry::Parallelepiped, AMP::Geometry::RegularPolygon, AMP::Geometry::Shell, AMP::Geometry::Sphere, AMP::Geometry::SphereSurface, AMP::Geometry::SquareFrustum, and AMP::Geometry::Tube.

Member Data Documentation

◆ d_ids

const std::array<int, 6> AMP::Geometry::LogicalGeometry::d_ids
protected

◆ d_logicalDim

const uint8_t AMP::Geometry::LogicalGeometry::d_logicalDim
protected

◆ d_physicalDim

const uint8_t AMP::Geometry::Geometry::d_physicalDim
protectedinherited

Definition at line 200 of file Geometry.h.

Referenced by AMP::Geometry::Geometry::getDim().


The documentation for this class was generated from the following file:



Advanced Multi-Physics (AMP)
Oak Ridge National Laboratory
Idaho National Laboratory
Los Alamos National Laboratory
This page automatically produced from the
source code by doxygen
Last updated: Tue Mar 10 2026 13:06:42.
Comments on this page