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

A derived class used to define a mesh element. More...

#include <libmeshMeshElement.h>

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

Public Types

using ElementListPtr = MeshElementVectorPtr
 

Public Member Functions

Point centroid () const override
 Return the centroid of the element.
 
std::unique_ptr< MeshElementclone () const override
 Clone the iterator.
 
bool containsPoint (const Point &pos, double TOL=1e-12) const override
 Return true if the element contains the point.
 
bool containsPoint (const std::vector< double > &pos, double TOL=1e-12) const
 Return true if the element contains the point.
 
Point coord () const override
 Return the coordinates of all vertices composing the element.
 
double coord (int i) const
 Return the coordinate of the vertex.
 
virtual double distance (const Point &pos, const Point &dir) const
 Calculate the distance to the element given a ray.
 
std::string elementClass () const override
 Return the element class.
 
GeomType elementType () const
 Return the element type.
 
const void * get () const
 Return the raw pointer to the element/node (if it exists)
 
ElementListPtr getElements (const GeomType type) const override
 Return the elements composing the current element.
 
int getElementsID (const GeomType type, MeshElementID *ID) const override
 Return the IDs of the elements composing the current element.
 
ElementListPtr getNeighbors () const override
 Return the elements neighboring the current element.
 
virtual void getNeighborVertices (std::vector< Point > &vertices) const
 
const typeIDgetTypeID () const override
 Return the typeID of the underlying element.
 
virtual void getVertices (std::vector< Point > &vertices) const
 
MeshElementID globalID () const override
 Return the unique global ID of the element.
 
unsigned int globalOwnerRank (const Mesh &mesh) const
 Return the owner rank according to AMP_COMM_WORLD.
 
bool isInBlock (int id) const override
 Check if the current element is in the given block.
 
bool isNull () const
 Is the mesh element null.
 
bool isOnBoundary (int id) const override
 Check if the current element is on the given boundary.
 
bool isOnSurface () const override
 Check if the element is on the surface.
 
 libmeshMeshElement ()
 Empty constructor for a MeshElement.
 
 libmeshMeshElement (const libmeshMeshElement &)
 Copy constructor.
 
 libmeshMeshElement (int dim, GeomType type, std::shared_ptr< libMesh::Elem > element, unsigned int rank, MeshID meshID, const libmeshMesh *mesh)
 
 libmeshMeshElement (int dim, GeomType type, void *element, unsigned int rank, MeshID meshID, const libmeshMesh *mesh)
 
virtual Point nearest (const Point &pos) const
 Calculate the nearest point on the element.
 
Point norm () const override
 Return the normal to the current element (does not apply to all elements)
 
bool operator!= (const MeshElement &rhs) const
 
bool operator!= (const MeshElementID &rhs) const
 
bool operator< (const MeshElement &rhs) const
 
bool operator< (const MeshElementID &rhs) const
 
bool operator<= (const MeshElement &rhs) const
 
bool operator<= (const MeshElementID &rhs) const
 
libmeshMeshElementoperator= (const libmeshMeshElement &)
 Assignment operator.
 
bool operator== (const MeshElement &rhs) const
 
bool operator== (const MeshElementID &rhs) const
 
bool operator> (const MeshElement &rhs) const
 
bool operator> (const MeshElementID &rhs) const
 
bool operator>= (const MeshElement &rhs) const
 
bool operator>= (const MeshElementID &rhs) const
 
std::string print (uint8_t indent=0) const
 Print info about the element.
 
double volume () const override
 Return the volume of the current element (does not apply to vertices)
 
virtual ~libmeshMeshElement ()
 De-constructor for a MeshElement.
 

Protected Attributes

bool d_delete_elem
 
int d_dim
 
MeshElementID d_globalID
 
const libmeshMeshd_mesh
 
MeshID d_meshID
 
unsigned int d_rank
 
std::shared_ptr< libMesh::Elem > ptr2
 
void * ptr_element
 

Detailed Description

A derived class used to define a mesh element.

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. This class is derived to store a libMesh element.

Definition at line 32 of file libmeshMeshElement.h.

Member Typedef Documentation

◆ ElementListPtr

Definition at line 29 of file MeshElement.h.

Constructor & Destructor Documentation

◆ libmeshMeshElement() [1/4]

AMP::Mesh::libmeshMeshElement::libmeshMeshElement ( )

Empty constructor for a MeshElement.

◆ libmeshMeshElement() [2/4]

AMP::Mesh::libmeshMeshElement::libmeshMeshElement ( const libmeshMeshElement )

Copy constructor.

◆ ~libmeshMeshElement()

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

De-constructor for a MeshElement.

◆ libmeshMeshElement() [3/4]

AMP::Mesh::libmeshMeshElement::libmeshMeshElement ( int  dim,
GeomType  type,
void *  element,
unsigned int  rank,
MeshID  meshID,
const libmeshMesh mesh 
)

Default constructors

Parameters
dimSpatial dimension
typeElement type
elementUnderlying libmesh element
meshUnderlying mesh
rankRank of the current processor (must agree with libmesh->processor_id())
meshIDID of the current mesh

◆ libmeshMeshElement() [4/4]

AMP::Mesh::libmeshMeshElement::libmeshMeshElement ( int  dim,
GeomType  type,
std::shared_ptr< libMesh::Elem >  element,
unsigned int  rank,
MeshID  meshID,
const libmeshMesh mesh 
)

Member Function Documentation

◆ centroid()

Point AMP::Mesh::libmeshMeshElement::centroid ( ) const
overridevirtual

Return the centroid of the element.

This function returns the centroid of the element. The centroid is defined as the average of the coordinates of the vertices. The centroid of a vertex is the vertex and will return the same result as coord().

Reimplemented from AMP::Mesh::MeshElement.

◆ clone()

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

Clone the iterator.

Reimplemented from AMP::Mesh::MeshElement.

◆ containsPoint() [1/2]

bool AMP::Mesh::libmeshMeshElement::containsPoint ( const Point pos,
double  TOL = 1e-12 
) const
overridevirtual

Return true if the element contains the point.

This function checks if the given point is inside or within TOL of the given element. If the current element is a vertex, this function checks if the point is with TOL of the vertex.

Parameters
posThe coordinates of the point to check.
TOLThe tolerance to use for the computation.

Reimplemented from AMP::Mesh::MeshElement.

◆ containsPoint() [2/2]

bool AMP::Mesh::MeshElement::containsPoint ( const std::vector< double > &  pos,
double  TOL = 1e-12 
) const
inherited

Return true if the element contains the point.

This function checks if the given point is inside or within TOL of the given element. If the current element is a vertex, this function checks if the point is with TOL of the vertex.

Parameters
posThe coordinates of the point to check.
TOLThe tolerance to use for the computation.

◆ coord() [1/2]

Point AMP::Mesh::libmeshMeshElement::coord ( ) const
overridevirtual

Return the coordinates of all vertices composing the element.

Reimplemented from AMP::Mesh::MeshElement.

◆ coord() [2/2]

double AMP::Mesh::MeshElement::coord ( int  i) const
inlineinherited

Return the coordinate of the vertex.

This function returns the coordinates of the vertex in the given direction (only applies to vertices).

Parameters
iThe direction requested. Equivalent to coord()[i]

Definition at line 61 of file MeshElement.h.

References AMP::Mesh::MeshElement::coord().

Referenced by AMP::Mesh::MeshElement::coord().

◆ distance()

virtual double AMP::Mesh::MeshElement::distance ( const Point pos,
const Point dir 
) const
virtualinherited

Calculate the distance to the element given a ray.

This function computes the distance to the element given a ray. If the ray will never intersect the element, 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 element surface

Reimplemented in AMP::Mesh::structuredMeshElement, and AMP::Mesh::TriangleMeshElement< NG >.

◆ elementClass()

std::string AMP::Mesh::libmeshMeshElement::elementClass ( ) const
inlineoverridevirtual

Return the element class.

Reimplemented from AMP::Mesh::MeshElement.

Definition at line 54 of file libmeshMeshElement.h.

◆ elementType()

GeomType AMP::Mesh::MeshElement::elementType ( ) const
inlineinherited

Return the element type.

Definition at line 39 of file MeshElement.h.

References AMP::Mesh::MeshElement::globalID(), and AMP::Mesh::MeshElementID::type().

◆ get()

const void * AMP::Mesh::libmeshMeshElement::get ( ) const
inline

Return the raw pointer to the element/node (if it exists)

Definition at line 110 of file libmeshMeshElement.h.

References ptr_element.

◆ getElements()

ElementListPtr AMP::Mesh::libmeshMeshElement::getElements ( const GeomType  type) const
overridevirtual

Return the elements composing the current element.

Reimplemented from AMP::Mesh::MeshElement.

◆ getElementsID()

int AMP::Mesh::libmeshMeshElement::getElementsID ( const GeomType  type,
MeshElementID ID 
) const
overridevirtual

Return the IDs of the elements composing the current element.

Reimplemented from AMP::Mesh::MeshElement.

◆ getNeighbors()

ElementListPtr AMP::Mesh::libmeshMeshElement::getNeighbors ( ) const
overridevirtual

Return the elements neighboring the current element.

Reimplemented from AMP::Mesh::MeshElement.

◆ getNeighborVertices()

virtual void AMP::Mesh::MeshElement::getNeighborVertices ( std::vector< Point > &  vertices) const
virtualinherited

Return the vertex coordinates for all neighboring elements excluding verticies composing the current element. Note the default implementation will call getNeighbors followed by getVertices, derived classes may implement a more efficient alternative

◆ getTypeID()

const typeID & AMP::Mesh::libmeshMeshElement::getTypeID ( ) const
overridevirtual

Return the typeID of the underlying element.

Reimplemented from AMP::Mesh::MeshElement.

◆ getVertices()

virtual void AMP::Mesh::MeshElement::getVertices ( std::vector< Point > &  vertices) const
virtualinherited

Return the vertex coordinates composing the current element. For a node, this will return the equivalent to coord(). For an element, this will return the equivalent to getElements(Vertex)->coord(). Note the default implementation will call getElements followed by coord, derived classes may implement a more efficient alternative

Reimplemented in AMP::Mesh::structuredMeshElement.

◆ globalID()

MeshElementID AMP::Mesh::libmeshMeshElement::globalID ( ) const
inlineoverridevirtual

Return the unique global ID of the element.

Reimplemented from AMP::Mesh::MeshElement.

Definition at line 48 of file libmeshMeshElement.h.

References d_globalID.

◆ globalOwnerRank()

unsigned int AMP::Mesh::MeshElement::globalOwnerRank ( const Mesh mesh) const
inherited

Return the owner rank according to AMP_COMM_WORLD.

◆ isInBlock()

bool AMP::Mesh::libmeshMeshElement::isInBlock ( int  id) const
overridevirtual

Check if the current element is in the given block.

Check if the current element is in the block specified by the given id

Parameters
idThe block id to check

Reimplemented from AMP::Mesh::MeshElement.

◆ isNull()

bool AMP::Mesh::MeshElement::isNull ( ) const
inlineinherited

Is the mesh element null.

Definition at line 36 of file MeshElement.h.

References AMP::Mesh::MeshElement::globalID(), and AMP::Mesh::MeshElementID::isNull().

◆ isOnBoundary()

bool AMP::Mesh::libmeshMeshElement::isOnBoundary ( int  id) const
overridevirtual

Check if the current element is on the given boundary.

Check if the current element is on the boundary specified by the given id

Parameters
idThe boundary id to check

Reimplemented from AMP::Mesh::MeshElement.

◆ isOnSurface()

bool AMP::Mesh::libmeshMeshElement::isOnSurface ( ) const
overridevirtual

Check if the element is on the surface.

Reimplemented from AMP::Mesh::MeshElement.

◆ nearest()

virtual Point AMP::Mesh::MeshElement::nearest ( const Point pos) const
virtualinherited

Calculate the nearest point on the element.

This function computes nearest point on/in the element to the given point

Parameters
[in]posCurrent position of the point

Reimplemented in AMP::Mesh::structuredMeshElement, and AMP::Mesh::TriangleMeshElement< NG >.

◆ norm()

Point AMP::Mesh::libmeshMeshElement::norm ( ) const
overridevirtual

Return the normal to the current element (does not apply to all elements)

Reimplemented from AMP::Mesh::MeshElement.

◆ operator!=() [1/2]

bool AMP::Mesh::MeshElement::operator!= ( const MeshElement rhs) const
inlineinherited

Definition at line 43 of file MeshElement.h.

References AMP::Mesh::MeshElement::globalID().

◆ operator!=() [2/2]

bool AMP::Mesh::MeshElement::operator!= ( const MeshElementID rhs) const
inlineinherited

Definition at line 49 of file MeshElement.h.

References AMP::Mesh::MeshElement::globalID().

◆ operator<() [1/2]

bool AMP::Mesh::MeshElement::operator< ( const MeshElement rhs) const
inlineinherited

Definition at line 44 of file MeshElement.h.

References AMP::Mesh::MeshElement::globalID().

◆ operator<() [2/2]

bool AMP::Mesh::MeshElement::operator< ( const MeshElementID rhs) const
inlineinherited

Definition at line 50 of file MeshElement.h.

References AMP::Mesh::MeshElement::globalID().

◆ operator<=() [1/2]

bool AMP::Mesh::MeshElement::operator<= ( const MeshElement rhs) const
inlineinherited

Definition at line 46 of file MeshElement.h.

References AMP::Mesh::MeshElement::globalID().

◆ operator<=() [2/2]

bool AMP::Mesh::MeshElement::operator<= ( const MeshElementID rhs) const
inlineinherited

Definition at line 52 of file MeshElement.h.

References AMP::Mesh::MeshElement::globalID().

◆ operator=()

libmeshMeshElement & AMP::Mesh::libmeshMeshElement::operator= ( const libmeshMeshElement )

Assignment operator.

◆ operator==() [1/2]

bool AMP::Mesh::MeshElement::operator== ( const MeshElement rhs) const
inlineinherited

Definition at line 42 of file MeshElement.h.

References AMP::Mesh::MeshElement::globalID().

◆ operator==() [2/2]

bool AMP::Mesh::MeshElement::operator== ( const MeshElementID rhs) const
inlineinherited

Definition at line 48 of file MeshElement.h.

References AMP::Mesh::MeshElement::globalID().

◆ operator>() [1/2]

bool AMP::Mesh::MeshElement::operator> ( const MeshElement rhs) const
inlineinherited

Definition at line 45 of file MeshElement.h.

References AMP::Mesh::MeshElement::globalID().

◆ operator>() [2/2]

bool AMP::Mesh::MeshElement::operator> ( const MeshElementID rhs) const
inlineinherited

Definition at line 51 of file MeshElement.h.

References AMP::Mesh::MeshElement::globalID().

◆ operator>=() [1/2]

bool AMP::Mesh::MeshElement::operator>= ( const MeshElement rhs) const
inlineinherited

Definition at line 47 of file MeshElement.h.

References AMP::Mesh::MeshElement::globalID().

◆ operator>=() [2/2]

bool AMP::Mesh::MeshElement::operator>= ( const MeshElementID rhs) const
inlineinherited

Definition at line 53 of file MeshElement.h.

References AMP::Mesh::MeshElement::globalID().

◆ print()

std::string AMP::Mesh::MeshElement::print ( uint8_t  indent = 0) const
inherited

Print info about the element.

This function returns debug info about the element

Parameters
indentThe number of spaces to indent new lines

◆ volume()

double AMP::Mesh::libmeshMeshElement::volume ( ) const
overridevirtual

Return the volume of the current element (does not apply to vertices)

Reimplemented from AMP::Mesh::MeshElement.

Member Data Documentation

◆ d_delete_elem

bool AMP::Mesh::libmeshMeshElement::d_delete_elem
protected

Definition at line 146 of file libmeshMeshElement.h.

◆ d_dim

int AMP::Mesh::libmeshMeshElement::d_dim
protected

Definition at line 140 of file libmeshMeshElement.h.

◆ d_globalID

MeshElementID AMP::Mesh::libmeshMeshElement::d_globalID
protected

Definition at line 147 of file libmeshMeshElement.h.

Referenced by globalID().

◆ d_mesh

const libmeshMesh* AMP::Mesh::libmeshMeshElement::d_mesh
protected

Definition at line 144 of file libmeshMeshElement.h.

◆ d_meshID

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

Definition at line 145 of file libmeshMeshElement.h.

◆ d_rank

unsigned int AMP::Mesh::libmeshMeshElement::d_rank
protected

Definition at line 141 of file libmeshMeshElement.h.

◆ ptr2

std::shared_ptr<libMesh::Elem> AMP::Mesh::libmeshMeshElement::ptr2
protected

Definition at line 143 of file libmeshMeshElement.h.

◆ ptr_element

void* AMP::Mesh::libmeshMeshElement::ptr_element
protected

Definition at line 142 of file libmeshMeshElement.h.

Referenced by get().


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