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

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

#include <MeshGeometry.h>

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

Public Member Functions

std::pair< Point, Pointbox () const override
 Return the bounding box.
 
Point centroid () const override
 Return the centroid.
 
std::unique_ptr< AMP::Geometry::Geometryclone () const override
 Clone the object.
 
void displace (const double *x) override
 Displace the entire geometry.
 
double distance (const Point &pos, const Point &dir) const override
 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.
 
const AMP::Mesh::MeshgetMesh () const
 Get the mesh.
 
std::string getName () const override
 Get the name of the geometry.
 
bool inside (const Point &pos) const override
 Is the point in the geometry.
 
bool isConvex () const override
 Is the object convex.
 
 MeshGeometry (const MeshGeometry &)=delete
 Copy constructor.
 
 MeshGeometry (int64_t)
 
 MeshGeometry (std::shared_ptr< AMP::Mesh::Mesh > mesh)
 Default constructor.
 
Point nearest (const Point &pos) const override
 Calculate the nearest point on the surface.
 
int NSurface () const override
 Get the number of surfaces.
 
bool operator!= (const Geometry &rhs) const
 Check if two geometries are not equal.
 
MeshGeometryoperator= (const MeshGeometry &)=delete
 Assignment operator.
 
bool operator== (const Geometry &rhs) const override
 Check if two geometries are equal.
 
virtual void registerChildObjects (AMP::IO::RestartManager *manager) const
 Register child objects.
 
int surface (const Point &x) const override
 Get the surface id.
 
Point surfaceNorm (const Point &x) const override
 Return the outward normal to a surface.
 
double volume () const override
 Return the volume.
 
virtual ~MeshGeometry ()=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

void writeRestart (int64_t) const override
 Write restart data to file.
 

Protected Attributes

const uint8_t d_physicalDim
 

Private Member Functions

void updateCache () const
 

Private Attributes

Point d_centroid
 
AMP::Mesh::ElementFinder d_find
 
kdtree2< 3, bool > d_inside
 
bool d_isConvex
 
std::shared_ptr< AMP::Mesh::Meshd_mesh
 
uint64_t d_pos_hash
 
std::vector< int > d_surfaceIds
 
double d_volume
 

Detailed Description

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

This class provides a geometry implementation based on a surface mesh

Definition at line 20 of file MeshGeometry.h.

Constructor & Destructor Documentation

◆ MeshGeometry() [1/3]

AMP::Geometry::MeshGeometry::MeshGeometry ( std::shared_ptr< AMP::Mesh::Mesh mesh)

Default constructor.

◆ ~MeshGeometry()

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

Destructor.

◆ MeshGeometry() [2/3]

AMP::Geometry::MeshGeometry::MeshGeometry ( const MeshGeometry )
delete

Copy constructor.

◆ MeshGeometry() [3/3]

AMP::Geometry::MeshGeometry::MeshGeometry ( int64_t  )

Member Function Documentation

◆ box()

std::pair< Point, Point > AMP::Geometry::MeshGeometry::box ( ) const
overridevirtual

Return the bounding box.

This function will return the bounding box of the object

Returns
Returns the bounding box [lb,ub]

Implements AMP::Geometry::Geometry.

◆ 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()

Point AMP::Geometry::MeshGeometry::centroid ( ) const
overridevirtual

Return the centroid.

This function will return centroid of the object

Returns
Returns the physical coordinates

Implements AMP::Geometry::Geometry.

◆ clone()

std::unique_ptr< AMP::Geometry::Geometry > AMP::Geometry::MeshGeometry::clone ( ) const
overridevirtual

Clone the object.

Implements AMP::Geometry::Geometry.

◆ displace()

void AMP::Geometry::MeshGeometry::displace ( const double *  x)
overridevirtual

Displace the entire geometry.

This function will displace the entire geometry by a scalar value. The displacement vector should be the size of the physical dimension.

Parameters
[in]xDisplacement vector

Implements AMP::Geometry::Geometry.

◆ distance()

double AMP::Geometry::MeshGeometry::distance ( const Point pos,
const Point dir 
) const
overridevirtual

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)

Implements AMP::Geometry::Geometry.

◆ 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()

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

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
virtualinherited

Return a unique hash id.

◆ getMesh()

const AMP::Mesh::Mesh & AMP::Geometry::MeshGeometry::getMesh ( ) const
inline

Get the mesh.

Definition at line 132 of file MeshGeometry.h.

References d_mesh.

◆ getName()

std::string AMP::Geometry::MeshGeometry::getName ( ) const
inlineoverridevirtual

Get the name of the geometry.

Implements AMP::Geometry::Geometry.

Definition at line 36 of file MeshGeometry.h.

◆ inside()

bool AMP::Geometry::MeshGeometry::inside ( const Point pos) const
overridevirtual

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)

Implements AMP::Geometry::Geometry.

◆ isConvex()

bool AMP::Geometry::MeshGeometry::isConvex ( ) const
overridevirtual

Is the object convex.

Check if the geometric object is convex

Returns
Returns true if the object is convex

Implements AMP::Geometry::Geometry.

◆ nearest()

Point AMP::Geometry::MeshGeometry::nearest ( const Point pos) const
overridevirtual

Calculate the nearest point on the surface.

This function computes the nearest point on the surface

Parameters
[in]posCurrent position of ray
Returns
Returns the nearest surface point

Implements AMP::Geometry::Geometry.

◆ NSurface()

int AMP::Geometry::MeshGeometry::NSurface ( ) const
overridevirtual

Get the number of surfaces.

This function will return the number of unique surfaces

Returns
Returns the number of unique surfaces

Implements AMP::Geometry::Geometry.

◆ 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=()

MeshGeometry & AMP::Geometry::MeshGeometry::operator= ( const MeshGeometry )
delete

Assignment operator.

◆ operator==()

bool AMP::Geometry::MeshGeometry::operator== ( const Geometry rhs) const
overridevirtual

Check if two geometries are equal.

Implements AMP::Geometry::Geometry.

◆ 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()

int AMP::Geometry::MeshGeometry::surface ( const Point x) const
overridevirtual

Get the surface id.

This function will return the surface id closest to the point

Parameters
[in]xCurrent position
Returns
Returns the surface id (0:NSurface-1)

Implements AMP::Geometry::Geometry.

◆ surfaceNorm()

Point AMP::Geometry::MeshGeometry::surfaceNorm ( const Point x) const
overridevirtual

Return the outward normal to a surface.

This function will return the surface id and outward normal to the surface at the given point

Parameters
[in]xCurrent position
Returns
Returns the surface normal

Implements AMP::Geometry::Geometry.

◆ updateCache()

void AMP::Geometry::MeshGeometry::updateCache ( ) const
private

◆ volume()

double AMP::Geometry::MeshGeometry::volume ( ) const
overridevirtual

Return the volume.

This function will return the interior volume of the object

Returns
Returns the volume

Implements AMP::Geometry::Geometry.

◆ writeRestart()

void AMP::Geometry::MeshGeometry::writeRestart ( int64_t  fid) const
overrideprotectedvirtual

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.

Member Data Documentation

◆ d_centroid

Point AMP::Geometry::MeshGeometry::d_centroid
mutableprivate

Definition at line 151 of file MeshGeometry.h.

◆ d_find

AMP::Mesh::ElementFinder AMP::Geometry::MeshGeometry::d_find
private

Definition at line 152 of file MeshGeometry.h.

◆ d_inside

kdtree2<3, bool> AMP::Geometry::MeshGeometry::d_inside
mutableprivate

Definition at line 153 of file MeshGeometry.h.

◆ d_isConvex

bool AMP::Geometry::MeshGeometry::d_isConvex
mutableprivate

Definition at line 149 of file MeshGeometry.h.

◆ d_mesh

std::shared_ptr<AMP::Mesh::Mesh> AMP::Geometry::MeshGeometry::d_mesh
private

Definition at line 146 of file MeshGeometry.h.

Referenced by getMesh().

◆ 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().

◆ d_pos_hash

uint64_t AMP::Geometry::MeshGeometry::d_pos_hash
mutableprivate

Definition at line 148 of file MeshGeometry.h.

◆ d_surfaceIds

std::vector<int> AMP::Geometry::MeshGeometry::d_surfaceIds
private

Definition at line 147 of file MeshGeometry.h.

◆ d_volume

double AMP::Geometry::MeshGeometry::d_volume
mutableprivate

Definition at line 150 of file MeshGeometry.h.


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