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

A concrete geometry class for a multi-mesh. More...

#include <MultiGeometry.h>

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

Public Member Functions

std::pair< Point, Pointbox () const override final
 Return the bounding box.
 
Point centroid () const override final
 Return the centroid.
 
std::unique_ptr< AMP::Geometry::Geometryclone () const override final
 Clone the object.
 
void displace (const double *x) override final
 Displace the entire geometry.
 
double distance (const Point &pos, const Point &dir) const override final
 Calculate the distance to the object given a ray.
 
uint8_t getDim () const
 Get the number of dimensions for the object.
 
const auto & getGeometries () const
 Access the geometries.
 
virtual AMP::Mesh::GeomType getGeomType () const
 Get the geometric type for the geometry.
 
virtual uint64_t getID () const
 Return a unique hash id.
 
std::string getName () const override final
 Get the name of the geometry.
 
bool inside (const Point &pos) const override final
 Is the point in the geometry.
 
bool isConvex () const override final
 Is the object convex.
 
 MultiGeometry (const std::vector< std::shared_ptr< Geometry > > &geom)
 Constructor to create a MultiMesh from existing meshes.
 
 MultiGeometry (int64_t fid, AMP::IO::RestartManager *manager)
 
Point nearest (const Point &pos) const override final
 Calculate the nearest point on the surface.
 
int NSurface () const override final
 Get the number of surfaces.
 
bool operator!= (const Geometry &rhs) const
 Check if two geometries are not equal.
 
bool operator== (const Geometry &rhs) const override final
 Check if two geometries are equal.
 
void registerChildObjects (AMP::IO::RestartManager *manager) const override
 Register child objects.
 
int surface (const Point &x) const override final
 Get the surface id.
 
Point surfaceNorm (const Point &x) const override final
 Return the outward normal to a surface.
 
double volume () const override final
 Return the volume.
 
void writeRestart (int64_t fid) const override
 Write restart data to file.
 
virtual ~MultiGeometry ()=default
 Destructor.
 

Static Public Member Functions

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

Protected Attributes

const uint8_t d_physicalDim
 

Private Member Functions

 MultiGeometry ()=delete
 Empty constructor for a mesh.
 

Private Attributes

std::vector< std::shared_ptr< Geometry > > d_geom
 

Detailed Description

A concrete geometry class for a multi-mesh.

This class provides routines for creating and accessing geometry functions for a multi-mesh.

Definition at line 17 of file MultiGeometry.h.

Constructor & Destructor Documentation

◆ MultiGeometry() [1/3]

AMP::Geometry::MultiGeometry::MultiGeometry ( const std::vector< std::shared_ptr< Geometry > > &  geom)
explicit

Constructor to create a MultiMesh from existing meshes.

This constructor takes a list of meshes and a communicator and generates the appropriate multimesh

Parameters
geomSub-geometries

◆ ~MultiGeometry()

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

Destructor.

◆ MultiGeometry() [2/3]

AMP::Geometry::MultiGeometry::MultiGeometry ( int64_t  fid,
AMP::IO::RestartManager manager 
)

◆ MultiGeometry() [3/3]

AMP::Geometry::MultiGeometry::MultiGeometry ( )
privatedelete

Empty constructor for a mesh.

Member Function Documentation

◆ box()

std::pair< Point, Point > AMP::Geometry::MultiGeometry::box ( ) const
finaloverridevirtual

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::MultiGeometry::centroid ( ) const
finaloverridevirtual

Return the centroid.

This function will return the centroid of the object. The centroid is equivalent to the center of mass of object of uniform density.

Returns
Returns the physical coordinates

Implements AMP::Geometry::Geometry.

◆ clone()

std::unique_ptr< AMP::Geometry::Geometry > AMP::Geometry::MultiGeometry::clone ( ) const
finaloverridevirtual

Clone the object.

Implements AMP::Geometry::Geometry.

◆ displace()

void AMP::Geometry::MultiGeometry::displace ( const double *  x)
finaloverridevirtual

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::MultiGeometry::distance ( const Point pos,
const Point dir 
) const
finaloverridevirtual

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.

◆ getGeometries()

const auto & AMP::Geometry::MultiGeometry::getGeometries ( ) const
inline

Access the geometries.

Definition at line 34 of file MultiGeometry.h.

References d_geom.

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

◆ getName()

std::string AMP::Geometry::MultiGeometry::getName ( ) const
inlinefinaloverridevirtual

Get the name of the geometry.

Implements AMP::Geometry::Geometry.

Definition at line 37 of file MultiGeometry.h.

◆ inside()

bool AMP::Geometry::MultiGeometry::inside ( const Point pos) const
finaloverridevirtual

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::MultiGeometry::isConvex ( ) const
inlinefinaloverridevirtual

Is the object convex.

Check if the geometric object is convex

Returns
Returns true if the object is convex

Implements AMP::Geometry::Geometry.

Definition at line 38 of file MultiGeometry.h.

◆ nearest()

Point AMP::Geometry::MultiGeometry::nearest ( const Point pos) const
finaloverridevirtual

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::MultiGeometry::NSurface ( ) const
finaloverridevirtual

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

bool AMP::Geometry::MultiGeometry::operator== ( const Geometry rhs) const
finaloverridevirtual

Check if two geometries are equal.

Implements AMP::Geometry::Geometry.

◆ registerChildObjects()

void AMP::Geometry::MultiGeometry::registerChildObjects ( AMP::IO::RestartManager manager) const
overridevirtual

Register child objects.

This function register child objects if necessary

Parameters
managerRestart manager

Reimplemented from AMP::Geometry::Geometry.

◆ surface()

int AMP::Geometry::MultiGeometry::surface ( const Point x) const
finaloverridevirtual

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::MultiGeometry::surfaceNorm ( const Point x) const
finaloverridevirtual

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.

◆ volume()

double AMP::Geometry::MultiGeometry::volume ( ) const
finaloverridevirtual

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::MultiGeometry::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.

Member Data Documentation

◆ d_geom

std::vector<std::shared_ptr<Geometry> > AMP::Geometry::MultiGeometry::d_geom
private

Definition at line 61 of file MultiGeometry.h.

Referenced by getGeometries().

◆ 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