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::Geometry Class Referenceabstract

A class used to abstract away geometry information from an application or mesh. More...

#include <Geometry.h>

Inheritance diagram for AMP::Geometry::Geometry:
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.
 
virtual AMP::Mesh::GeomType getGeomType () const
 Get the geometric type for the geometry.
 
virtual uint64_t getID () const
 Return a unique hash id.
 
virtual std::string getName () const =0
 Get the name of the geometry.
 
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 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 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.
 
virtual void writeRestart (int64_t fid) const
 Write restart data to file.
 
virtual ~Geometry ()=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

 Geometry (const Geometry &)=default
 
 Geometry (Geometry &&)=delete
 
 Geometry (int ndim)
 Empty constructor for the base class.
 
 Geometry (int64_t fid)
 Initialize the base class from file.
 
Geometryoperator= (const Geometry &)=delete
 
Geometryoperator= (Geometry &&)=delete
 

Protected Attributes

const uint8_t d_physicalDim
 

Detailed Description

A class used to abstract away geometry information from an application or mesh.

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

Definition at line 28 of file Geometry.h.

Constructor & Destructor Documentation

◆ ~Geometry()

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

Destructor.

◆ Geometry() [1/4]

AMP::Geometry::Geometry::Geometry ( int64_t  fid)
protected

Initialize the base class from file.

◆ Geometry() [2/4]

AMP::Geometry::Geometry::Geometry ( int  ndim)
inlineprotected

Empty constructor for the base class.

Definition at line 190 of file Geometry.h.

◆ Geometry() [3/4]

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

◆ Geometry() [4/4]

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

Member Function Documentation

◆ box()

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

◆ buildGeometry()

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

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 virtual

◆ clone()

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

◆ displace()

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

◆ distance()

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

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
inline

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 d_physicalDim.

◆ getGeomType()

virtual AMP::Mesh::GeomType AMP::Geometry::Geometry::getGeomType ( ) const
virtual

Get the geometric type for the geometry.

This function returns the largest geometric type supported by the geometry

Returns
Returns the geometric dimensions

Reimplemented in AMP::Geometry::LogicalGeometry.

◆ getID()

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

Return a unique hash id.

◆ getName()

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

◆ inside()

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

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 virtual

◆ nearest()

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

◆ NSurface()

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

◆ operator!=()

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

Check if two geometries are not equal.

Definition at line 151 of file Geometry.h.

References operator==().

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ operator==()

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

◆ registerChildObjects()

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

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 virtual

◆ surfaceNorm()

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

◆ volume()

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

◆ writeRestart()

virtual void AMP::Geometry::Geometry::writeRestart ( int64_t  fid) const
virtual

Member Data Documentation

◆ d_physicalDim

const uint8_t AMP::Geometry::Geometry::d_physicalDim
protected

Definition at line 200 of file Geometry.h.

Referenced by 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