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

A concrete mesh class for libMesh. More...

#include <libmeshMesh.h>

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

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

std::unique_ptr< Meshclone () const override
 Function to copy the mesh (allows use to proply copy the derived class)
 
virtual bool containsElement (const MeshElementID &id) const
 
void displaceMesh (const std::vector< double > &x) override
 Displace the entire mesh.
 
void displaceMesh (std::shared_ptr< const AMP::LinearAlgebra::Vector > x) override
 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 override
 Return an MeshIterator over the given geometric objects on the given block ID set.
 
std::vector< int > getBlockIDs () const override
 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 override
 Return an MeshIterator over the given geometric objects on the given boundary ID set.
 
std::vector< int > getBoundaryIDs () const override
 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.
 
std::unique_ptr< MeshElementgetElement (const MeshElementID &id) const override
 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.
 
MeshIterator getIterator (const GeomType type, const int gcw=0) const override
 Return an MeshIterator over the given geometric objects.
 
std::shared_ptr< libMesh::Mesh > getlibMesh () const
 Return the underlying libMesh object.
 
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 override
 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.
 
Mesh::Movable isMeshMovable () const override
 Is the mesh movable.
 
 libmeshMesh (std::shared_ptr< const MeshParameters > params)
 Read in mesh files, partition domain, and prepare environment for simulation.
 
 libmeshMesh (std::shared_ptr< libMesh::Mesh > mesh, const std::string &name, std::shared_ptr< libMesh::Parallel::Communicator > libMeshComm=nullptr)
 Constructor to create a libmeshMesh object from a libMesh mesh.
 
std::string meshClass () const override
 Return a string with the mesh class name.
 
MeshID meshID () const
 Get the mesh ID.
 
size_t numGhostElements (const GeomType type, const int gcw) const override
 
size_t numGlobalElements (const GeomType type) const override
 
size_t numLocalElements (const GeomType type) const override
 
bool operator!= (const Mesh &mesh) const
 Check if two meshes are not equal.
 
bool operator== (const Mesh &mesh) const override
 Check if two meshes are equal.
 
uint64_t positionHash () const override
 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.
 
void writeRestart (int64_t fid) const override
 Write restart data to file.
 
virtual ~libmeshMesh ()
 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

std::vector< libMesh::Node * > getNeighborNodes (const MeshElementID &) const
 
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_
 

Private Types

typedef std::shared_ptr< std::vector< libmeshMeshElement > > ElemListPtr
 

Private Member Functions

void fillBoundaryElements ()
 
ElemListPtr generateGhostElements (GeomType) const
 
ElemListPtr generateGhosts () const
 
ElemListPtr generateLocalElements (GeomType) const
 
void initialize ()
 
 libmeshMesh ()
 
libmeshElemIterator localElements () const
 

Private Attributes

std::vector< int > d_block_ids
 
std::map< std::pair< int, GeomType >, ElemListPtrd_boundarySets
 
ElemListPtr d_ghostElements [4]
 
std::vector< ElemListPtrd_ghostSurfaceElements
 
std::shared_ptr< libMesh::Mesh > d_libMesh
 
std::shared_ptr< libMesh::Parallel::Communicator > d_libMeshComm
 
ElemListPtr d_localElements [4]
 
std::vector< ElemListPtrd_localSurfaceElements
 
uint64_t d_pos_hash
 
std::shared_ptr< initializeLibMeshlibmeshInit
 
std::vector< size_t > n_ghost
 
std::vector< size_t > n_global
 
std::vector< size_t > n_local
 
std::vector< unsigned int > neighborNodeIDs
 
std::vector< std::vector< libMesh::Node * > > neighborNodes
 

Friends

class libmeshMeshElement
 

Detailed Description

A concrete mesh class for libMesh.

This class provides routines for reading, accessing and writing libMesh meshes. The generation of the mesh is controlled by the database passed in through the params object. The database fields control the mesh and provide several options:

dim - required integer specifying the physical dimension
FileName - If specified this will load the mesh from the given file
Generator - If specified this will generate a new mesh using the optional parameters in the
database
This field must be a string specifying the generator to use. Valid gerators are:
"cube" - Will generate a cube mesh
Additional areguments:
size - Integer array specifying the number of elements in each direction

The parallel decomposition of the mesh is controlled by libmesh and occurs on the communicator specified through the params object. Note that libmesh does not support meshes on overlapping communicators. If multiple meshes are used, they must either share communicators or have unique communicators.

Definition at line 45 of file libmeshMesh.h.

Member Typedef Documentation

◆ ElementListPtr

Definition at line 70 of file Mesh.h.

◆ ElemListPtr

typedef std::shared_ptr<std::vector<libmeshMeshElement> > AMP::Mesh::libmeshMesh::ElemListPtr
private

Definition at line 264 of file libmeshMesh.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>
inherited

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
stronginherited

Enumeration for basic mesh-based quantities.

Enumerator
Fixed 
Displace 
Deform 

Definition at line 73 of file Mesh.h.

Constructor & Destructor Documentation

◆ libmeshMesh() [1/3]

AMP::Mesh::libmeshMesh::libmeshMesh ( 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

◆ libmeshMesh() [2/3]

AMP::Mesh::libmeshMesh::libmeshMesh ( std::shared_ptr< libMesh::Mesh >  mesh,
const std::string &  name,
std::shared_ptr< libMesh::Parallel::Communicator >  libMeshComm = nullptr 
)
explicit

Constructor to create a libmeshMesh object from a libMesh mesh.

This constructor allows the user to construct a mesh directly in libmesh and use it to create the new mesh object. This function is intended for advanced users only. Note: the user is responsible for ensuring that libMesh is properly initialized (using initializeLibMesh), and that the mesh is created properly.

Parameters
meshThe mesh in libmesh we want to use to construct the new mesh object
nameThe name of the new mesh object
libMeshCommOptional libMesh communicator to use

◆ ~libmeshMesh()

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

Deconstructor.

◆ libmeshMesh() [3/3]

AMP::Mesh::libmeshMesh::libmeshMesh ( )
inlineprivate

Definition at line 268 of file libmeshMesh.h.

Member Function Documentation

◆ clone()

std::unique_ptr< Mesh > AMP::Mesh::libmeshMesh::clone ( ) const
overridevirtual

Function to copy the mesh (allows use to proply copy the derived class)

Implements AMP::Mesh::Mesh.

◆ compare()

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

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
virtualinherited

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 
)
staticinherited

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]

void AMP::Mesh::libmeshMesh::displaceMesh ( const std::vector< double > &  x)
overridevirtual

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

Implements AMP::Mesh::Mesh.

◆ displaceMesh() [2/2]

void AMP::Mesh::libmeshMesh::displaceMesh ( std::shared_ptr< const AMP::LinearAlgebra::Vector x)
overridevirtual

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.

Implements AMP::Mesh::Mesh.

◆ estimateMeshSize()

static size_t AMP::Mesh::libmeshMesh::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

◆ fillBoundaryElements()

void AMP::Mesh::libmeshMesh::fillBoundaryElements ( )
private

◆ generateGhostElements()

ElemListPtr AMP::Mesh::libmeshMesh::generateGhostElements ( GeomType  ) const
private

◆ generateGhosts()

ElemListPtr AMP::Mesh::libmeshMesh::generateGhosts ( ) const
private

◆ generateLocalElements()

ElemListPtr AMP::Mesh::libmeshMesh::generateLocalElements ( GeomType  ) const
private

◆ getAllMeshIDs()

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

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
virtualinherited

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::libmeshMesh::getBlockIDIterator ( const GeomType  type,
const int  id,
const int  gcw = 0 
) const
overridevirtual

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 from AMP::Mesh::Mesh.

◆ getBlockIDs()

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

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 from AMP::Mesh::Mesh.

◆ getBoundaryIDIterator()

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

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

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

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

Reimplemented from AMP::Mesh::Mesh.

◆ getBoundaryIDs()

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

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 from AMP::Mesh::Mesh.

◆ getBoundingBox()

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

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 AMP::Mesh::Mesh::d_box.

◆ getComm()

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

Get the communicator for the mesh.

Definition at line 336 of file Mesh.h.

References AMP::Mesh::Mesh::d_comm.

◆ getDim()

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

Get the physical dimension of the mesh.

Definition at line 332 of file Mesh.h.

References AMP::Mesh::Mesh::PhysicalDim.

◆ getElement()

std::unique_ptr< MeshElement > AMP::Mesh::libmeshMesh::getElement ( const MeshElementID id) const
overridevirtual

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. This function uses libmesh for elements it owns, and uses an O(ln(N)) for elements that were constructed internally.

Parameters
idMesh element id we are requesting.

Reimplemented from AMP::Mesh::Mesh.

◆ getElementParents()

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

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

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 AMP::Mesh::Mesh::d_geometry.

◆ getGeometry() [2/2]

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

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 AMP::Mesh::Mesh::d_geometry.

◆ getGeomType()

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

Get the largest geometric type in the mesh.

Definition at line 328 of file Mesh.h.

References AMP::Mesh::Mesh::GeomDim.

◆ getIterator() [1/5]

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

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 from AMP::Mesh::Mesh.

◆ getIterator() [2/5]

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

◆ getIterator() [3/5]

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

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  
)
staticinherited

◆ getIterator() [5/5]

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

◆ getlibMesh()

std::shared_ptr< libMesh::Mesh > AMP::Mesh::libmeshMesh::getlibMesh ( ) const
inline

Return the underlying libMesh object.

Definition at line 229 of file libmeshMesh.h.

References d_libMesh.

◆ getLocalBaseMeshIDs()

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

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
inlineinherited

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 AMP::Mesh::Mesh::d_box_local.

◆ getLocalMeshIDs()

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

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
inlineinherited

Get the maximum ghost width.

Definition at line 340 of file Mesh.h.

References AMP::Mesh::Mesh::d_max_gcw.

◆ getName()

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

Get the mesh name.

Definition at line 395 of file Mesh.h.

References AMP::Mesh::Mesh::d_name.

◆ getNeighborNodes()

std::vector< libMesh::Node * > AMP::Mesh::libmeshMesh::getNeighborNodes ( const MeshElementID ) const
protected

Function to return the neighbors for a node. The neighbors are defined as those nodes that share an element with the given node. Note: the nodes returns are returned in unsorted order.

◆ getPositionVector()

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

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::libmeshMesh::getSurfaceIterator ( const GeomType  type,
const int  gcw = 0 
) const
overridevirtual

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 from AMP::Mesh::Mesh.

◆ initialize()

void AMP::Mesh::libmeshMesh::initialize ( )
private

◆ isBaseMesh()

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

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
virtualinherited

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
virtualinherited

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

Mesh::Movable AMP::Mesh::libmeshMesh::isMeshMovable ( ) const
overridevirtual

Is the mesh movable.

This function will check if the mesh can be displaced. It will return 0 if the mesh cannont be moved, 1 if it can be displaced, and 2 if the individual nodes can be moved.

Returns
The if

Implements AMP::Mesh::Mesh.

◆ localElements()

libmeshElemIterator AMP::Mesh::libmeshMesh::localElements ( ) const
private

◆ maxProcs()

static size_t AMP::Mesh::libmeshMesh::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()

std::string AMP::Mesh::libmeshMesh::meshClass ( ) const
overridevirtual

Return a string with the mesh class name.

Implements AMP::Mesh::Mesh.

◆ meshID()

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

Get the mesh ID.

Definition at line 344 of file Mesh.h.

References AMP::Mesh::Mesh::d_meshID.

◆ numGhostElements()

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

Reimplemented from AMP::Mesh::Mesh.

◆ numGlobalElements()

size_t AMP::Mesh::libmeshMesh::numGlobalElements ( const GeomType  type) const
overridevirtual

Reimplemented from AMP::Mesh::Mesh.

◆ numLocalElements()

size_t AMP::Mesh::libmeshMesh::numLocalElements ( const GeomType  type) const
overridevirtual

Reimplemented from AMP::Mesh::Mesh.

◆ operator!=()

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

Check if two meshes are not equal.

Definition at line 356 of file Mesh.h.

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

◆ operator==()

bool AMP::Mesh::libmeshMesh::operator== ( const Mesh mesh) const
overridevirtual

Check if two meshes are equal.

Implements AMP::Mesh::Mesh.

◆ positionHash()

uint64_t AMP::Mesh::libmeshMesh::positionHash ( ) const
overridevirtual

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

Implements AMP::Mesh::Mesh.

◆ printMeshHierarchy()

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

Print the mesh hierarchy<iostream>

◆ reduceBox()

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

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

◆ registerChildObjects()

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

Register child objects.

This function register child objects if necessary

Parameters
managerRestart manager

Reimplemented in AMP::Mesh::MultiMesh.

◆ setMeshID()

void AMP::Mesh::Mesh::setMeshID ( )
protectedinherited

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)
inlinevirtualinherited

Set the mesh name.

Definition at line 399 of file Mesh.h.

References AMP::Mesh::Mesh::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
virtualinherited

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
virtualinherited

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
virtualinherited

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
virtualinherited

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

void AMP::Mesh::libmeshMesh::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::Mesh::Mesh.

Friends And Related Symbol Documentation

◆ libmeshMeshElement

friend class libmeshMeshElement
friend

Definition at line 262 of file libmeshMesh.h.

Member Data Documentation

◆ d_block_ids

std::vector<int> AMP::Mesh::libmeshMesh::d_block_ids
private

Definition at line 304 of file libmeshMesh.h.

◆ d_boundarySets

std::map<std::pair<int, GeomType>, ElemListPtr> AMP::Mesh::libmeshMesh::d_boundarySets
private

Definition at line 297 of file libmeshMesh.h.

◆ d_box

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

The bounding box for the mesh.

Definition at line 564 of file Mesh.h.

Referenced by AMP::Mesh::Mesh::getBoundingBox().

◆ d_box_local

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

The bounding box for the mesh.

Definition at line 565 of file Mesh.h.

Referenced by AMP::Mesh::Mesh::getLocalBoundingBox().

◆ d_comm

AMP_MPI AMP::Mesh::Mesh::d_comm
protectedinherited

The communicator over which the mesh is stored.

Definition at line 562 of file Mesh.h.

Referenced by AMP::Mesh::Mesh::getComm().

◆ d_geometry

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

The geometry parameters.

Definition at line 566 of file Mesh.h.

Referenced by AMP::Mesh::Mesh::getGeometry(), and AMP::Mesh::Mesh::getGeometry().

◆ d_ghostElements

ElemListPtr AMP::Mesh::libmeshMesh::d_ghostElements[4]
private

Definition at line 294 of file libmeshMesh.h.

◆ d_ghostSurfaceElements

std::vector<ElemListPtr> AMP::Mesh::libmeshMesh::d_ghostSurfaceElements
private

Definition at line 301 of file libmeshMesh.h.

◆ d_libMesh

std::shared_ptr<libMesh::Mesh> AMP::Mesh::libmeshMesh::d_libMesh
private

Definition at line 281 of file libmeshMesh.h.

Referenced by getlibMesh().

◆ d_libMeshComm

std::shared_ptr<libMesh::Parallel::Communicator> AMP::Mesh::libmeshMesh::d_libMeshComm
private

Definition at line 282 of file libmeshMesh.h.

◆ d_localElements

ElemListPtr AMP::Mesh::libmeshMesh::d_localElements[4]
private

Definition at line 293 of file libmeshMesh.h.

◆ d_localSurfaceElements

std::vector<ElemListPtr> AMP::Mesh::libmeshMesh::d_localSurfaceElements
private

Definition at line 300 of file libmeshMesh.h.

◆ d_max_gcw

uint8_t AMP::Mesh::Mesh::d_max_gcw
protectedinherited

The maximum ghost cell width.

Definition at line 560 of file Mesh.h.

Referenced by AMP::Mesh::Mesh::getMaxGhostWidth().

◆ d_meshID

MeshID AMP::Mesh::Mesh::d_meshID
protectedinherited

A unique id for each mesh.

Definition at line 561 of file Mesh.h.

Referenced by AMP::Mesh::Mesh::meshID().

◆ d_name

std::string AMP::Mesh::Mesh::d_name
protectedinherited

A name for the mesh.

Definition at line 563 of file Mesh.h.

Referenced by AMP::Mesh::Mesh::getName(), and AMP::Mesh::Mesh::setName().

◆ d_pos_hash

uint64_t AMP::Mesh::libmeshMesh::d_pos_hash
private

Definition at line 278 of file libmeshMesh.h.

◆ GeomDim

GeomType AMP::Mesh::Mesh::GeomDim
protectedinherited

The geometric dimension.

Definition at line 558 of file Mesh.h.

Referenced by AMP::Mesh::Mesh::getGeomType().

◆ libmeshInit

std::shared_ptr<initializeLibMesh> AMP::Mesh::libmeshMesh::libmeshInit
private

Definition at line 286 of file libmeshMesh.h.

◆ n_ghost

std::vector<size_t> AMP::Mesh::libmeshMesh::n_ghost
private

Definition at line 285 of file libmeshMesh.h.

◆ n_global

std::vector<size_t> AMP::Mesh::libmeshMesh::n_global
private

Definition at line 285 of file libmeshMesh.h.

◆ n_local

std::vector<size_t> AMP::Mesh::libmeshMesh::n_local
private

Definition at line 285 of file libmeshMesh.h.

◆ neighborNodeIDs

std::vector<unsigned int> AMP::Mesh::libmeshMesh::neighborNodeIDs
private

Definition at line 289 of file libmeshMesh.h.

◆ neighborNodes

std::vector<std::vector<libMesh::Node *> > AMP::Mesh::libmeshMesh::neighborNodes
private

Definition at line 290 of file libmeshMesh.h.

◆ PhysicalDim

uint8_t AMP::Mesh::Mesh::PhysicalDim
protectedinherited

The physical dimension.

Definition at line 559 of file Mesh.h.

Referenced by AMP::Mesh::Mesh::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