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

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

#include <Mesh.h>

Inheritance diagram for AMP::Mesh::Mesh:
Inheritance graph
[legend]

Classes

struct  CompareResult
 Structure used to compare matricies. More...
 

Public Types

using ElementListPtr = MeshElementVectorPtr
 
typedef std::function< std::shared_ptr< Mesh >(std::shared_ptr< const MeshParameters >)> generatorType
 Generator for meshes.
 
using MeshElementPtr = std::unique_ptr< MeshElement >
 Pointer to MeshElement and MeshElementVector.
 
enum class  Movable : uint8_t { Fixed = 0 , Displace = 1 , Deform = 2 }
 Enumeration for basic mesh-based quantities. More...
 

Public Member Functions

virtual std::unique_ptr< Meshclone () const =0
 Virtual function to clone the mesh (allows us to properly copy the derived class)
 
virtual bool containsElement (const MeshElementID &id) const
 
virtual void displaceMesh (const std::vector< double > &x)=0
 Displace the entire mesh.
 
virtual void displaceMesh (std::shared_ptr< const AMP::LinearAlgebra::Vector > x)=0
 Displace the entire mesh.
 
virtual std::vector< MeshIDgetAllMeshIDs () const
 
virtual std::vector< MeshIDgetBaseMeshIDs () const
 
virtual MeshIterator getBlockIDIterator (const GeomType type, const int id, const int gcw=0) const
 Return an MeshIterator over the given geometric objects on the given block ID set.
 
virtual std::vector< int > getBlockIDs () const
 Return the list of all boundary ID sets in the mesh.
 
virtual MeshIterator getBoundaryIDIterator (const GeomType type, const int id, const int gcw=0) const
 Iterate on the given boundary ID.
 
virtual std::vector< int > getBoundaryIDs () const
 Return the list of all boundary ID sets in the mesh.
 
const auto & getBoundingBox () const
 Get the bounding box for the mesh.
 
const AMP_MPIgetComm () const
 Get the communicator for the mesh.
 
uint8_t getDim () const
 Get the physical dimension of the mesh.
 
virtual MeshElementPtr getElement (const MeshElementID &id) const
 Return a mesh element given it's id.
 
virtual ElementListPtr getElementParents (const MeshElement &elem, const GeomType type) const
 Return the parent elements of the given mesh element.
 
auto getGeometry ()
 Return the geometry of the mesh.
 
auto getGeometry () const
 Return the geometry of the mesh.
 
GeomType getGeomType () const
 Get the largest geometric type in the mesh.
 
virtual MeshIterator getIterator (const GeomType type, const int gcw=0) const
 Return an MeshIterator over the given geometric objects.
 
virtual std::vector< MeshIDgetLocalBaseMeshIDs () const
 
const auto & getLocalBoundingBox () const
 Get the bounding box for the local part of the mesh.
 
virtual std::vector< MeshIDgetLocalMeshIDs () const
 
uint8_t getMaxGhostWidth () const
 Get the maximum ghost width.
 
virtual std::string getName () const
 Get the mesh name.
 
virtual std::shared_ptr< AMP::LinearAlgebra::VectorgetPositionVector (std::string name, const int gcw=0) const
 Get a vector of the coordinates of the nodes.
 
virtual MeshIterator getSurfaceIterator (const GeomType type, const int gcw=0) const
 Return an MeshIterator over the given geometric objects on the surface.
 
virtual bool isBaseMesh () const
 Is the current mesh a base mesh.
 
virtual bool isMember (const MeshElementID &id) const
 Check if an element is in the mesh.
 
virtual MeshIterator isMember (const MeshIterator &it) const
 Check if elements are in the mesh.
 
virtual Movable isMeshMovable () const =0
 Is the mesh movable.
 
 Mesh (const std::shared_ptr< Mesh > &old_mesh, MeshIterator &iterator)
 Construct a new mesh from an existing mesh.
 
 Mesh (std::shared_ptr< const MeshParameters > params)
 Read in mesh files, partition domain, and prepare environment for simulation.
 
virtual std::string meshClass () const =0
 Return a string with the mesh class name.
 
MeshID meshID () const
 Get the mesh ID.
 
virtual size_t numGhostElements (const GeomType type, const int gcw) const
 
virtual size_t numGlobalElements (const GeomType type) const
 
virtual size_t numLocalElements (const GeomType type) const
 
bool operator!= (const Mesh &mesh) const
 Check if two meshes are not equal.
 
virtual bool operator== (const Mesh &mesh) const =0
 Check if two meshes are equal.
 
virtual uint64_t positionHash () const =0
 Identify if the position has moved.
 
virtual void registerChildObjects (AMP::IO::RestartManager *manager) const
 Register child objects.
 
virtual void setName (std::string name)
 Set the mesh name.
 
std::shared_ptr< AMP::Mesh::Meshshared_from_this ()
 
std::shared_ptr< const AMP::Mesh::Meshshared_from_this () const
 
virtual std::shared_ptr< MeshSubset (const MeshIterator &iterator, bool isGlobal=true) const
 Subset a mesh given a MeshIterator.
 
virtual std::shared_ptr< MeshSubset (Mesh &mesh) const
 Subset a mesh given another mesh.
 
virtual std::shared_ptr< MeshSubset (MeshID meshID) const
 Subset a mesh given a MeshID.
 
virtual std::shared_ptr< MeshSubset (std::string name) const
 Subset a mesh given a mesh name.
 
virtual void writeRestart (int64_t fid) const
 Write restart data to file.
 
virtual ~Mesh ()
 Deconstructor.
 

Static Public Member Functions

static CompareResult compare (const Mesh &a, const Mesh &b)
 Compare two meshes.
 
static std::shared_ptr< MeshcreateView (const Mesh &mesh, const AMP::Database &db)
 Create a view of existing mesh(s)
 
static size_t estimateMeshSize (std::shared_ptr< const MeshParameters > params)
 Estimate the number of elements in the mesh.
 
static MeshIterator getIterator (SetOP OP, const MeshIterator &, MeshIteratorEnd)
 
static MeshIterator getIterator (SetOP OP, const MeshIterator &A, const MeshIterator &B)
 Return an MeshIterator constructed through a set operation of two other MeshIterators.
 
static MeshIterator getIterator (SetOP OP, MeshIteratorEnd, const MeshIterator &)
 
static MeshIterator getIterator (SetOP OP, MeshIteratorEnd, MeshIteratorEnd)
 
static size_t maxProcs (std::shared_ptr< const MeshParameters > params)
 Return the maximum number of processors that can be used with the mesh.
 
static void printMeshHierarchy (const Mesh &mesh, std::ostream &out=std::cout, const std::string &prefix="")
 Print the mesh hierarchy<iostream>
 

Protected Member Functions

 Mesh ()
 Empty constructor for a mesh.
 
 Mesh (const Mesh &old)
 
 Mesh (int64_t fid, AMP::IO::RestartManager *manager)
 Initialize the base class from file.
 
Meshoperator= (const Mesh &old)=delete
 
void setMeshID ()
 

Static Protected Member Functions

static std::vector< double > reduceBox (const std::vector< double > &, const AMP_MPI &)
 Fill the domain box from the local box (requires communication)
 

Protected Attributes

std::vector< double > d_box
 The bounding box for the mesh.
 
std::vector< double > d_box_local
 The bounding box for the mesh.
 
AMP_MPI d_comm
 The communicator over which the mesh is stored.
 
std::shared_ptr< Geometry::Geometryd_geometry
 The geometry parameters.
 
uint8_t d_max_gcw
 The maximum ghost cell width.
 
MeshID d_meshID
 A unique id for each mesh.
 
std::string d_name
 A name for the mesh.
 
GeomType GeomDim
 The geometric dimension.
 
uint8_t PhysicalDim
 The physical dimension.
 
std::weak_ptr< AMP::Mesh::Meshweak_ptr_
 

Detailed Description

A class used to abstract away mesh from an application.

A class used to pass the parameters for creating a mesh.

A class used to define a mesh element.

This class provides routines for reading, accessing and writing meshes. The database fields control the mesh and will differ for each mesh type. However, there are some common fields to all meshes: MeshName - The name to associate with the mesh MeshType - The mesh type (libMesh, Multimesh, AMP) x_offset - Optional argument specifying the offset in the x-direction y_offset - Optional argument specifying the offset in the y-direction z_offset - Optional argument specifying the offset in the z-direction NumberOfElements - Optional argument indicating the number of elements in the mesh (will override all other calulations) Weight - Optional argument indicating the relative weight of the mesh for the domain decomposition (relative to 1.0)

This class provides routines for accessing and using a mesh element. A mesh element can be thought of as the smallest unit of a mesh. It is of a type of GeomType. It contains the composing pieces of the element

Definition at line 56 of file Mesh.h.

Member Typedef Documentation

◆ ElementListPtr

Definition at line 70 of file Mesh.h.

◆ generatorType

Generator for meshes.

This is a user-supplied function to generate a mesh. Users may register their own mesh generators using registerGenerator and the mesh builder will call them.

Definition at line 66 of file Mesh.h.

◆ MeshElementPtr

using AMP::Mesh::Mesh::MeshElementPtr = std::unique_ptr<MeshElement>

Pointer to MeshElement and MeshElementVector.

Definition at line 69 of file Mesh.h.

Member Enumeration Documentation

◆ Movable

enum class AMP::Mesh::Mesh::Movable : uint8_t
strong

Enumeration for basic mesh-based quantities.

Enumerator
Fixed 
Displace 
Deform 

Definition at line 73 of file Mesh.h.

Constructor & Destructor Documentation

◆ Mesh() [1/5]

AMP::Mesh::Mesh::Mesh ( std::shared_ptr< const MeshParameters params)
explicit

Read in mesh files, partition domain, and prepare environment for simulation.

For trivial parallelsim, this method reads in the meshes on each processor. Each processor contains a piece of each mesh. For massive parallelism, each mesh is on its own communicator. As such, some math libraries must be initialized accordingly.

Parameters
paramsParameters for constructing a mesh from an input database

◆ Mesh() [2/5]

AMP::Mesh::Mesh::Mesh ( const std::shared_ptr< Mesh > &  old_mesh,
MeshIterator iterator 
)

Construct a new mesh from an existing mesh.

This constructor will construct a new mesh from an existing mesh using an iterator over the existing mesh. This is designed as a path to create a new mesh object of one type from an existing mesh of a different type. It also allows creating a new single mesh from a subset or superset of other meshes. Note that instantiation of this routine may not be able to create it's mesh from any arbitrary mesh, and may throw an error.

Parameters
old_meshExisting mesh that we will use to construct the new mesh
iteratorIterator over the existing mesh

◆ ~Mesh()

virtual AMP::Mesh::Mesh::~Mesh ( )
virtual

Deconstructor.

◆ Mesh() [3/5]

AMP::Mesh::Mesh::Mesh ( int64_t  fid,
AMP::IO::RestartManager manager 
)
protected

Initialize the base class from file.

◆ Mesh() [4/5]

AMP::Mesh::Mesh::Mesh ( )
protected

Empty constructor for a mesh.

◆ Mesh() [5/5]

AMP::Mesh::Mesh::Mesh ( const Mesh old)
explicitprotected

Member Function Documentation

◆ clone()

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

◆ compare()

static CompareResult AMP::Mesh::Mesh::compare ( const Mesh a,
const Mesh b 
)
static

Compare two meshes.

This function compares two meshes.

Parameters
[in]aFirst mesh to compare
[in]bSecond mesh to compare
Returns
Result of comparison

◆ containsElement()

virtual bool AMP::Mesh::Mesh::containsElement ( const MeshElementID id) const
virtual

Check if the mesh contains the given mesh element

Reimplemented in AMP::Mesh::MultiMesh, and AMP::Mesh::SubsetMesh.

◆ createView()

static std::shared_ptr< Mesh > AMP::Mesh::Mesh::createView ( const Mesh mesh,
const AMP::Database db 
)
static

Create a view of existing mesh(s)

This function creates a view of existing mesh(s)

Parameters
meshExisting mesh(s)
dbDatabase to control the view

◆ displaceMesh() [1/2]

virtual void AMP::Mesh::Mesh::displaceMesh ( const std::vector< double > &  x)
pure virtual

Displace the entire mesh.

This function will displace the entire mesh by a scalar value. This function is a blocking call for the mesh communicator, and requires the same value on all processors. The displacement vector should be the size of the physical dimension.

Parameters
xDisplacement vector

Implemented in AMP::Mesh::libmeshMesh, AMP::Mesh::MultiMesh, AMP::Mesh::MovableBoxMesh, AMP::Mesh::PureLogicalMesh, AMP::Mesh::StructuredGeometryMesh, AMP::Mesh::SubsetMesh, and AMP::Mesh::TriangleMesh< NG >.

◆ displaceMesh() [2/2]

virtual void AMP::Mesh::Mesh::displaceMesh ( std::shared_ptr< const AMP::LinearAlgebra::Vector x)
pure virtual

Displace the entire mesh.

This function will displace the entire mesh by displacing each node by the values provided in the vector. This function is a blocking call for the mesh communicator

Parameters
xDisplacement vector. Must have N DOFs per node where N is the physical dimension of the mesh.

Implemented in AMP::Mesh::libmeshMesh, AMP::Mesh::MultiMesh, AMP::Mesh::MovableBoxMesh, AMP::Mesh::SubsetMesh, AMP::Mesh::TriangleMesh< NG >, AMP::Mesh::PureLogicalMesh, and AMP::Mesh::StructuredGeometryMesh.

◆ estimateMeshSize()

static size_t AMP::Mesh::Mesh::estimateMeshSize ( std::shared_ptr< const MeshParameters params)
static

Estimate the number of elements in the mesh.

This function will estimate the number of elements in the mesh. This is used so that we can properly balance the meshes across multiple processors. Ideally this should be both an accurate estimate and very fast. It should not require any communication and should not have to actually load a mesh.

Parameters
paramsParameters for constructing a mesh from an input database

◆ getAllMeshIDs()

virtual std::vector< MeshID > AMP::Mesh::Mesh::getAllMeshIDs ( ) const
virtual

Get the meshIDs of all meshes that compose the current mesh (including its self) Note: This function may require global communication depending on the implementation

Reimplemented in AMP::Mesh::MultiMesh, and AMP::Mesh::SubsetMesh.

◆ getBaseMeshIDs()

virtual std::vector< MeshID > AMP::Mesh::Mesh::getBaseMeshIDs ( ) const
virtual

Get the meshIDs of all the basic meshes that compose the current mesh (excluding multimeshes and subset meshes) Note: This function may require global communication depending on the implementation

Reimplemented in AMP::Mesh::MultiMesh, and AMP::Mesh::SubsetMesh.

◆ getBlockIDIterator()

virtual MeshIterator AMP::Mesh::Mesh::getBlockIDIterator ( const GeomType  type,
const int  id,
const int  gcw = 0 
) const
virtual

Return an MeshIterator over the given geometric objects on the given block ID set.

Return an MeshIterator over the given geometric objects on the given block ID set

Parameters
typeGeometric type to iterate over
idBlock id for the elements (example: block id in cubit, subdomain in libmesh)
gcwDesired ghost cell width

Reimplemented in AMP::Mesh::libmeshMesh, AMP::Mesh::MultiMesh, AMP::Mesh::SubsetMesh, AMP::Mesh::BoxMesh, and AMP::Mesh::TriangleMesh< NG >.

◆ getBlockIDs()

virtual std::vector< int > AMP::Mesh::Mesh::getBlockIDs ( ) const
virtual

Return the list of all boundary ID sets in the mesh.

Return the list of all boundary ID sets in the mesh Note: depending on the mesh this routine may require global communication across the mesh.

Reimplemented in AMP::Mesh::libmeshMesh, AMP::Mesh::MultiMesh, AMP::Mesh::SubsetMesh, AMP::Mesh::BoxMesh, and AMP::Mesh::TriangleMesh< NG >.

◆ getBoundaryIDIterator()

virtual MeshIterator AMP::Mesh::Mesh::getBoundaryIDIterator ( const GeomType  type,
const int  id,
const int  gcw = 0 
) const
virtual

Iterate on the given boundary ID.

Return an MeshIterator over the given geometric objects on the given boundary ID

Parameters
typeGeometric type to iterate over
idBoundary id for the elements (example: sideset id)
gcwDesired ghost cell width

Reimplemented in AMP::Mesh::libmeshMesh, AMP::Mesh::MultiMesh, AMP::Mesh::SubsetMesh, AMP::Mesh::BoxMesh, and AMP::Mesh::TriangleMesh< NG >.

◆ getBoundaryIDs()

virtual std::vector< int > AMP::Mesh::Mesh::getBoundaryIDs ( ) const
virtual

Return the list of all boundary ID sets in the mesh.

Return the list of all boundary ID sets in the mesh Note: depending on the mesh this routine may require global communication across the mesh.

Reimplemented in AMP::Mesh::libmeshMesh, AMP::Mesh::MultiMesh, AMP::Mesh::SubsetMesh, AMP::Mesh::BoxMesh, and AMP::Mesh::TriangleMesh< NG >.

◆ getBoundingBox()

const auto & AMP::Mesh::Mesh::getBoundingBox ( ) const
inline

Get the bounding box for the mesh.

This function will return the bounding box for the entire mesh. The vector returned contains the box that contains the mesh in the form [ x_min x_max y_min y_max z_min z_max ].

Definition at line 408 of file Mesh.h.

References d_box.

◆ getComm()

const AMP_MPI & AMP::Mesh::Mesh::getComm ( ) const
inline

Get the communicator for the mesh.

Definition at line 336 of file Mesh.h.

References d_comm.

◆ getDim()

uint8_t AMP::Mesh::Mesh::getDim ( ) const
inline

Get the physical dimension of the mesh.

Definition at line 332 of file Mesh.h.

References PhysicalDim.

◆ getElement()

virtual MeshElementPtr AMP::Mesh::Mesh::getElement ( const MeshElementID id) const
virtual

Return a mesh element given it's id.

This function queries the mesh to get an element given the mesh id. This function is only required to return an element if the id is local. Ideally, this should be done in O(1) time, but the implementation is up to the underlying mesh. The base class provides a basic implementation, but uses mesh iterators and requires O(N) time on the number of elements in the mesh.

Parameters
idMesh element id we are requesting.

Reimplemented in AMP::Mesh::libmeshMesh, AMP::Mesh::MultiMesh, AMP::Mesh::SubsetMesh, AMP::Mesh::BoxMesh, and AMP::Mesh::TriangleMesh< NG >.

◆ getElementParents()

virtual ElementListPtr AMP::Mesh::Mesh::getElementParents ( const MeshElement elem,
const GeomType  type 
) const
virtual

Return the parent elements of the given mesh element.

This function queries the mesh to get an element given the mesh id, then returns the parent elements that have the element as a child

Parameters
elemMesh element of interest
typeElement type of the parents requested

Reimplemented in AMP::Mesh::MultiMesh, AMP::Mesh::SubsetMesh, AMP::Mesh::BoxMesh, and AMP::Mesh::TriangleMesh< NG >.

◆ getGeometry() [1/2]

auto AMP::Mesh::Mesh::getGeometry ( )
inline

Return the geometry of the mesh.

This function will return the geometry for the mesh if it exists. Not all meshes will have a geometry associated with them.

Definition at line 106 of file Mesh.h.

References d_geometry.

◆ getGeometry() [2/2]

auto AMP::Mesh::Mesh::getGeometry ( ) const
inline

Return the geometry of the mesh.

This function will return the geometry for the mesh if it exists. Not all meshes will have a geometry associated with them.

Definition at line 114 of file Mesh.h.

References d_geometry.

◆ getGeomType()

GeomType AMP::Mesh::Mesh::getGeomType ( ) const
inline

Get the largest geometric type in the mesh.

Definition at line 328 of file Mesh.h.

References GeomDim.

◆ getIterator() [1/5]

virtual MeshIterator AMP::Mesh::Mesh::getIterator ( const GeomType  type,
const int  gcw = 0 
) const
virtual

Return an MeshIterator over the given geometric objects.

Return an MeshIterator over the given geometric objects

Parameters
typeGeometric type to iterate over
gcwDesired ghost cell width

Reimplemented in AMP::Mesh::libmeshMesh, AMP::Mesh::MultiMesh, AMP::Mesh::SubsetMesh, AMP::Mesh::BoxMesh, and AMP::Mesh::TriangleMesh< NG >.

◆ getIterator() [2/5]

static MeshIterator AMP::Mesh::Mesh::getIterator ( SetOP  OP,
const MeshIterator ,
MeshIteratorEnd   
)
static

◆ getIterator() [3/5]

static MeshIterator AMP::Mesh::Mesh::getIterator ( SetOP  OP,
const MeshIterator A,
const MeshIterator B 
)
static

Return an MeshIterator constructed through a set operation of two other MeshIterators.

Return an MeshIterator constructed through a set operation of two other MeshIterators.

Parameters
OPSet operation to perform. SetOP::Union - Perform a union of the iterators ( A U B ) SetOP::Intersection - Perform an intersection of the iterators ( A n B ) SetOP::Complement - Perform a compliment of the iterators ( A - B )
APointer to MeshIterator A
BPointer to MeshIterator B

◆ getIterator() [4/5]

static MeshIterator AMP::Mesh::Mesh::getIterator ( SetOP  OP,
MeshIteratorEnd  ,
const MeshIterator  
)
static

◆ getIterator() [5/5]

static MeshIterator AMP::Mesh::Mesh::getIterator ( SetOP  OP,
MeshIteratorEnd  ,
MeshIteratorEnd   
)
static

◆ getLocalBaseMeshIDs()

virtual std::vector< MeshID > AMP::Mesh::Mesh::getLocalBaseMeshIDs ( ) const
virtual

Get the meshIDs of all the basic meshes that compose the current mesh (excluding multimeshes and subset meshes) on the current processor.

Reimplemented in AMP::Mesh::MultiMesh, and AMP::Mesh::SubsetMesh.

◆ getLocalBoundingBox()

const auto & AMP::Mesh::Mesh::getLocalBoundingBox ( ) const
inline

Get the bounding box for the local part of the mesh.

This function will return the bounding box for the local part of the mesh. The vector returned contains the box that contains the mesh in the form [ x_min x_max y_min y_max z_min z_max ].

Definition at line 417 of file Mesh.h.

References d_box_local.

◆ getLocalMeshIDs()

virtual std::vector< MeshID > AMP::Mesh::Mesh::getLocalMeshIDs ( ) const
virtual

Get the meshIDs of all meshes that compose the current mesh (including its self) on the current processor.

Reimplemented in AMP::Mesh::MultiMesh, and AMP::Mesh::SubsetMesh.

◆ getMaxGhostWidth()

uint8_t AMP::Mesh::Mesh::getMaxGhostWidth ( ) const
inline

Get the maximum ghost width.

Definition at line 340 of file Mesh.h.

References d_max_gcw.

◆ getName()

virtual std::string AMP::Mesh::Mesh::getName ( ) const
inlinevirtual

Get the mesh name.

Definition at line 395 of file Mesh.h.

References d_name.

◆ getPositionVector()

virtual std::shared_ptr< AMP::LinearAlgebra::Vector > AMP::Mesh::Mesh::getPositionVector ( std::string  name,
const int  gcw = 0 
) const
virtual

Get a vector of the coordinates of the nodes.

This function will return a const vector containing the coordinates of all the nodes.

Parameters
nameName of the vector
gcwDesired ghost cell width

◆ getSurfaceIterator()

virtual MeshIterator AMP::Mesh::Mesh::getSurfaceIterator ( const GeomType  type,
const int  gcw = 0 
) const
virtual

Return an MeshIterator over the given geometric objects on the surface.

Return an MeshIterator over the given geometric objects on the surface

Parameters
typeGeometric type to iterate over
gcwDesired ghost cell width

Reimplemented in AMP::Mesh::libmeshMesh, AMP::Mesh::MultiMesh, AMP::Mesh::SubsetMesh, AMP::Mesh::BoxMesh, and AMP::Mesh::TriangleMesh< NG >.

◆ isBaseMesh()

virtual bool AMP::Mesh::Mesh::isBaseMesh ( ) const
virtual

Is the current mesh a base mesh.

Reimplemented in AMP::Mesh::MultiMesh, and AMP::Mesh::SubsetMesh.

◆ isMember() [1/2]

virtual bool AMP::Mesh::Mesh::isMember ( const MeshElementID id) const
virtual

Check if an element is in the mesh.

This function queries the mesh to determine if the given element is a member of the mesh

Parameters
idMesh element id we are querying.

Reimplemented in AMP::Mesh::MultiMesh, and AMP::Mesh::SubsetMesh.

◆ isMember() [2/2]

virtual MeshIterator AMP::Mesh::Mesh::isMember ( const MeshIterator it) const
virtual

Check if elements are in the mesh.

This function queries the mesh to determine if each of the given elements is a member of the mesh and returns an iterator over those elements

Parameters
itIterator containing mesh element id we are querying.
Returns
Iterator containing elements that are part of the mesh

Reimplemented in AMP::Mesh::MultiMesh, and AMP::Mesh::SubsetMesh.

◆ isMeshMovable()

virtual Movable AMP::Mesh::Mesh::isMeshMovable ( ) const
pure virtual

Is the mesh movable.

This function will check if the mesh can be displaced.

Returns
enum indicating the extent the mesh can be moved

Implemented in AMP::Mesh::libmeshMesh, AMP::Mesh::MultiMesh, AMP::Mesh::MovableBoxMesh, AMP::Mesh::PureLogicalMesh, AMP::Mesh::StructuredGeometryMesh, AMP::Mesh::SubsetMesh, and AMP::Mesh::TriangleMesh< NG >.

◆ maxProcs()

static size_t AMP::Mesh::Mesh::maxProcs ( std::shared_ptr< const MeshParameters params)
static

Return the maximum number of processors that can be used with the mesh.

This function will return the maximum number of processors that can be used with the mesh.

Parameters
paramsParameters for constructing a mesh from an input database

◆ meshClass()

virtual std::string AMP::Mesh::Mesh::meshClass ( ) const
pure virtual

◆ meshID()

MeshID AMP::Mesh::Mesh::meshID ( ) const
inline

Get the mesh ID.

Definition at line 344 of file Mesh.h.

References d_meshID.

◆ numGhostElements()

virtual size_t AMP::Mesh::Mesh::numGhostElements ( const GeomType  type,
const int  gcw 
) const
virtual

◆ numGlobalElements()

virtual size_t AMP::Mesh::Mesh::numGlobalElements ( const GeomType  type) const
virtual

◆ numLocalElements()

virtual size_t AMP::Mesh::Mesh::numLocalElements ( const GeomType  type) const
virtual

◆ operator!=()

bool AMP::Mesh::Mesh::operator!= ( const Mesh mesh) const
inline

Check if two meshes are not equal.

Definition at line 356 of file Mesh.h.

References operator==().

◆ operator=()

Mesh & AMP::Mesh::Mesh::operator= ( const Mesh old)
protecteddelete

◆ operator==()

virtual bool AMP::Mesh::Mesh::operator== ( const Mesh mesh) const
pure virtual

◆ positionHash()

virtual uint64_t AMP::Mesh::Mesh::positionHash ( ) const
pure virtual

Identify if the position has moved.

This function will return a hash that can be used to identify if the mesh has been moved. Any time that displaceMesh is called, the hash value should change. There is no requirement that dispacing a mesh and returning it back to the original position will return the original hash.

Returns
hash value with current position id

Implemented in AMP::Mesh::libmeshMesh, AMP::Mesh::MultiMesh, AMP::Mesh::MovableBoxMesh, AMP::Mesh::PureLogicalMesh, AMP::Mesh::StructuredGeometryMesh, AMP::Mesh::SubsetMesh, and AMP::Mesh::TriangleMesh< NG >.

◆ printMeshHierarchy()

static void AMP::Mesh::Mesh::printMeshHierarchy ( const Mesh mesh,
std::ostream &  out = std::cout,
const std::string &  prefix = "" 
)
static

Print the mesh hierarchy<iostream>

◆ reduceBox()

static std::vector< double > AMP::Mesh::Mesh::reduceBox ( const std::vector< double > &  ,
const AMP_MPI  
)
staticprotected

Fill the domain box from the local box (requires communication)

◆ registerChildObjects()

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

Register child objects.

This function register child objects if necessary

Parameters
managerRestart manager

Reimplemented in AMP::Mesh::MultiMesh.

◆ setMeshID()

void AMP::Mesh::Mesh::setMeshID ( )
protected

A function to create a unique id for the mesh (requires the comm to be set) Note: this requires a global communication across the mesh communicator. Note: this function is NOT thread safe, and will need to be modified before threads are used.

◆ setName()

virtual void AMP::Mesh::Mesh::setName ( std::string  name)
inlinevirtual

Set the mesh name.

Definition at line 399 of file Mesh.h.

References d_name.

◆ shared_from_this() [1/2]

std::shared_ptr< AMP::Mesh::Mesh > AMP::enable_shared_from_this< AMP::Mesh::Mesh >::shared_from_this ( )
inlineinherited

Definition at line 28 of file enable_shared_from_this.h.

◆ shared_from_this() [2/2]

std::shared_ptr< const AMP::Mesh::Mesh > AMP::enable_shared_from_this< AMP::Mesh::Mesh >::shared_from_this ( ) const
inlineinherited

Definition at line 46 of file enable_shared_from_this.h.

◆ Subset() [1/4]

virtual std::shared_ptr< Mesh > AMP::Mesh::Mesh::Subset ( const MeshIterator iterator,
bool  isGlobal = true 
) const
virtual

Subset a mesh given a MeshIterator.

This function will subset a mesh over a given iterator. This will return a new mesh object.

Parameters
iteratorMeshIterator used to subset
isGlobalIs the new subset mesh global over the entire mesh (true,default), or do we only want to keep the local mesh (false)

Reimplemented in AMP::Mesh::MultiMesh, AMP::Mesh::SubsetMesh, and AMP::Mesh::MultiMesh.

◆ Subset() [2/4]

virtual std::shared_ptr< Mesh > AMP::Mesh::Mesh::Subset ( Mesh mesh) const
virtual

Subset a mesh given another mesh.

This function will subset a mesh given another mesh

Parameters
meshMesh used to subset

Reimplemented in AMP::Mesh::MultiMesh, and AMP::Mesh::SubsetMesh.

◆ Subset() [3/4]

virtual std::shared_ptr< Mesh > AMP::Mesh::Mesh::Subset ( MeshID  meshID) const
virtual

Subset a mesh given a MeshID.

This function will return the mesh with the given meshID. Note: for multimeshes, this will return the mesh with the given id. For a single mesh this will return a pointer to itself if the meshID matches the meshID of the mesh, and a null pointer otherwise.

Parameters
meshIDMeshID of the desired mesh

Reimplemented in AMP::Mesh::MultiMesh, AMP::Mesh::SubsetMesh, AMP::Mesh::MultiMesh, and AMP::Mesh::SubsetMesh.

◆ Subset() [4/4]

virtual std::shared_ptr< Mesh > AMP::Mesh::Mesh::Subset ( std::string  name) const
virtual

Subset a mesh given a mesh name.

This function will return the mesh with the given name. For a single mesh this will return a pointer to itself if the mesh name matches the name of the mesh, and a null pointer otherwise. Note: The mesh name is not guaranteed to be unique. If there are multiple meshes with the same name, all meshed with the given name will be returned within a new multimesh. It is strongly recommended to use the meshID when possible.

Parameters
nameName of the desired mesh

Reimplemented in AMP::Mesh::MultiMesh, AMP::Mesh::SubsetMesh, AMP::Mesh::MultiMesh, and AMP::Mesh::SubsetMesh.

◆ writeRestart()

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

Write restart data to file.

This function will write the mesh to an HDF5 file

Parameters
fidFile identifier to write

Reimplemented in AMP::Mesh::libmeshMesh, AMP::Mesh::SubsetMesh, AMP::Mesh::TriangleMesh< NG >, AMP::Mesh::MultiMesh, AMP::Mesh::BoxMesh, AMP::Mesh::MovableBoxMesh, AMP::Mesh::PureLogicalMesh, and AMP::Mesh::StructuredGeometryMesh.

Member Data Documentation

◆ d_box

std::vector<double> AMP::Mesh::Mesh::d_box
protected

The bounding box for the mesh.

Definition at line 564 of file Mesh.h.

Referenced by getBoundingBox().

◆ d_box_local

std::vector<double> AMP::Mesh::Mesh::d_box_local
protected

The bounding box for the mesh.

Definition at line 565 of file Mesh.h.

Referenced by getLocalBoundingBox().

◆ d_comm

AMP_MPI AMP::Mesh::Mesh::d_comm
protected

The communicator over which the mesh is stored.

Definition at line 562 of file Mesh.h.

Referenced by getComm().

◆ d_geometry

std::shared_ptr<Geometry::Geometry> AMP::Mesh::Mesh::d_geometry
protected

The geometry parameters.

Definition at line 566 of file Mesh.h.

Referenced by getGeometry(), and getGeometry().

◆ d_max_gcw

uint8_t AMP::Mesh::Mesh::d_max_gcw
protected

The maximum ghost cell width.

Definition at line 560 of file Mesh.h.

Referenced by getMaxGhostWidth().

◆ d_meshID

MeshID AMP::Mesh::Mesh::d_meshID
protected

A unique id for each mesh.

Definition at line 561 of file Mesh.h.

Referenced by meshID().

◆ d_name

std::string AMP::Mesh::Mesh::d_name
protected

A name for the mesh.

Definition at line 563 of file Mesh.h.

Referenced by getName(), and setName().

◆ GeomDim

GeomType AMP::Mesh::Mesh::GeomDim
protected

The geometric dimension.

Definition at line 558 of file Mesh.h.

Referenced by getGeomType().

◆ PhysicalDim

uint8_t AMP::Mesh::Mesh::PhysicalDim
protected

The physical dimension.

Definition at line 559 of file Mesh.h.

Referenced by getDim().

◆ weak_ptr_

std::weak_ptr<AMP::Mesh::Mesh > AMP::enable_shared_from_this< AMP::Mesh::Mesh >::weak_ptr_
mutableprotectedinherited

Definition at line 69 of file enable_shared_from_this.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:43.
Comments on this page