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

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

#include <structuredMeshElement.h>

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

Public Types

using ElementListPtr = MeshElementVectorPtr
 

Public Member Functions

Point centroid () const override
 Return the centroid of the element.
 
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 final
 Return the coordinates of the vertex (only applies to vertices)
 
double coord (int i) const
 Return the coordinate of the vertex.
 
double distance (const MeshPoint< double > &pos, const MeshPoint< double > &dir) const override
 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.
 
virtual ElementListPtr getElements (const GeomType type) const
 Return the elements composing the current element.
 
ElementListPtr getElements (const GeomType) const override
 Return the elements composing the current element.
 
int getElementsID (const GeomType, MeshElementID *) const override
 Return the IDs of the elements composing the current element.
 
const auto & getIndex () const
 Return the index of the element.
 
int getNeighborIndex (BoxMesh::MeshElementIndex *index) const
 
virtual ElementListPtr getNeighbors () const
 
ElementListPtr getNeighbors () const override
 
virtual void getNeighborVertices (std::vector< Point > &vertices) const
 
ElementListPtr getParents (GeomType type) const
 Get the parents of the given element.
 
const typeIDgetTypeID () const override
 Return the typeID of the underlying element.
 
void getVertices (std::vector< Point > &vertices) const override
 
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.
 
MeshPoint< double > nearest (const MeshPoint< double > &pos) const override
 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
 
structuredMeshElementoperator= (const structuredMeshElement &)
 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.
 
void reset ()
 Reset the internal data to an empty element.
 
void reset (const BoxMesh::MeshElementIndex &index, const AMP::Mesh::BoxMesh *mesh)
 Reset the internal data to the given element.
 
 structuredMeshElement ()
 Empty constructor for a MeshElement.
 
 structuredMeshElement (const BoxMesh::MeshElementIndex &index, const AMP::Mesh::BoxMesh *mesh)
 
 structuredMeshElement (const structuredMeshElement &)
 Copy constructor.
 
double volume () const override
 Return the volume of the current element (does not apply to vertices)
 
virtual ~structuredMeshElement ()
 De-constructor for a MeshElement.
 

Protected Member Functions

std::unique_ptr< MeshElementclone () const override
 Clone the element.
 
std::array< int8_t, 3 > getBC () const
 
void getElementIndex (const GeomType type, int &N, BoxMesh::MeshElementIndex *index) const
 
void reset (const BoxMesh::MeshElementIndex &index)
 

Protected Attributes

BoxMesh::MeshElementIndex d_index
 
const AMP::Mesh::BoxMeshd_mesh
 
GeomType d_meshType
 
unsigned char d_physicalDim
 

Friends

class AMP::Mesh::BoxMesh
 
class AMP::Mesh::structuredMeshIterator
 

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 19 of file structuredMeshElement.h.

Member Typedef Documentation

◆ ElementListPtr

Definition at line 29 of file MeshElement.h.

Constructor & Destructor Documentation

◆ structuredMeshElement() [1/3]

AMP::Mesh::structuredMeshElement::structuredMeshElement ( )

Empty constructor for a MeshElement.

◆ structuredMeshElement() [2/3]

AMP::Mesh::structuredMeshElement::structuredMeshElement ( const structuredMeshElement )

Copy constructor.

◆ ~structuredMeshElement()

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

De-constructor for a MeshElement.

◆ structuredMeshElement() [3/3]

AMP::Mesh::structuredMeshElement::structuredMeshElement ( const BoxMesh::MeshElementIndex index,
const AMP::Mesh::BoxMesh mesh 
)

Default constructor

Parameters
indexIndex for the current elements
meshUnderlying mesh

Member Function Documentation

◆ centroid()

Point AMP::Mesh::structuredMeshElement::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::structuredMeshElement::clone ( ) const
overrideprotectedvirtual

Clone the element.

Reimplemented from AMP::Mesh::MeshElement.

◆ containsPoint() [1/2]

bool AMP::Mesh::structuredMeshElement::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::structuredMeshElement::coord ( ) const
inlinefinaloverridevirtual

Return the coordinates of the vertex (only applies to vertices)

Reimplemented from AMP::Mesh::MeshElement.

Definition at line 67 of file structuredMeshElement.h.

References AMP::Mesh::BoxMesh::coord(), d_index, d_mesh, d_physicalDim, AMP::Mesh::MeshPoint< TYPE >::data(), and AMP::Mesh::MeshPoint< TYPE >::setNdim().

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

double AMP::Mesh::structuredMeshElement::distance ( const MeshPoint< double > &  pos,
const MeshPoint< double > &  dir 
) const
overridevirtual

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

◆ elementClass()

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

Return the element class.

Reimplemented from AMP::Mesh::MeshElement.

Definition at line 60 of file structuredMeshElement.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().

◆ getBC()

std::array< int8_t, 3 > AMP::Mesh::structuredMeshElement::getBC ( ) const
protected

◆ getElementIndex()

void AMP::Mesh::structuredMeshElement::getElementIndex ( const GeomType  type,
int &  N,
BoxMesh::MeshElementIndex index 
) const
protected

◆ getElements() [1/2]

virtual ElementListPtr AMP::Mesh::MeshElement::getElements ( const GeomType  type) const
virtual

Return the elements composing the current element.

Reimplemented from AMP::Mesh::MeshElement.

◆ getElements() [2/2]

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

Return the elements composing the current element.

Reimplemented from AMP::Mesh::MeshElement.

◆ getElementsID()

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

Return the IDs of the elements composing the current element.

Reimplemented from AMP::Mesh::MeshElement.

◆ getIndex()

const auto & AMP::Mesh::structuredMeshElement::getIndex ( ) const
inline

Return the index of the element.

Definition at line 54 of file structuredMeshElement.h.

References d_index.

◆ getNeighborIndex()

int AMP::Mesh::structuredMeshElement::getNeighborIndex ( BoxMesh::MeshElementIndex index) const

◆ getNeighbors() [1/2]

virtual ElementListPtr AMP::Mesh::MeshElement::getNeighbors ( ) const
virtual

Return the elements neighboring the current element. One neighbor is returned for each side of the element. If the side is on the surface, then it's neighbor is null. For Verticies, a list of all vertices that share an element is returned. This list is in unsorted order.

Reimplemented from AMP::Mesh::MeshElement.

◆ getNeighbors() [2/2]

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

Return the elements neighboring the current element. One neighbor is returned for each side of the element. If the side is on the surface, then it's neighbor is null. For Verticies, a list of all vertices that share an element is returned. This list is in unsorted order.

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

◆ getParents()

ElementListPtr AMP::Mesh::structuredMeshElement::getParents ( GeomType  type) const

Get the parents of the given element.

This function will get the parent elements of the current element

Parameters
typeThe desired type of the parents to get

◆ getTypeID()

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

Return the typeID of the underlying element.

Reimplemented from AMP::Mesh::MeshElement.

◆ getVertices()

void AMP::Mesh::structuredMeshElement::getVertices ( std::vector< Point > &  vertices) const
overridevirtual

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

◆ globalID()

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

Return the unique global ID of the element.

Reimplemented from AMP::Mesh::MeshElement.

Definition at line 59 of file structuredMeshElement.h.

References AMP::Mesh::BoxMesh::convert(), d_index, and d_mesh.

◆ 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::structuredMeshElement::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::structuredMeshElement::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::structuredMeshElement::isOnSurface ( ) const
overridevirtual

Check if the element is on the surface.

Reimplemented from AMP::Mesh::MeshElement.

◆ nearest()

MeshPoint< double > AMP::Mesh::structuredMeshElement::nearest ( const MeshPoint< double > &  pos) const
overridevirtual

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

◆ norm()

Point AMP::Mesh::structuredMeshElement::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=()

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

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

◆ reset() [1/3]

void AMP::Mesh::structuredMeshElement::reset ( )

Reset the internal data to an empty element.

◆ reset() [2/3]

void AMP::Mesh::structuredMeshElement::reset ( const BoxMesh::MeshElementIndex index)
inlineprotected

Definition at line 102 of file structuredMeshElement.h.

References d_index.

◆ reset() [3/3]

void AMP::Mesh::structuredMeshElement::reset ( const BoxMesh::MeshElementIndex index,
const AMP::Mesh::BoxMesh mesh 
)

Reset the internal data to the given element.

◆ volume()

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

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

Reimplemented from AMP::Mesh::MeshElement.

Friends And Related Symbol Documentation

◆ AMP::Mesh::BoxMesh

friend class AMP::Mesh::BoxMesh
friend

Definition at line 104 of file structuredMeshElement.h.

◆ AMP::Mesh::structuredMeshIterator

friend class AMP::Mesh::structuredMeshIterator
friend

Definition at line 105 of file structuredMeshElement.h.

Member Data Documentation

◆ d_index

BoxMesh::MeshElementIndex AMP::Mesh::structuredMeshElement::d_index
protected

Definition at line 94 of file structuredMeshElement.h.

Referenced by coord(), getIndex(), globalID(), and reset().

◆ d_mesh

const AMP::Mesh::BoxMesh* AMP::Mesh::structuredMeshElement::d_mesh
protected

Definition at line 95 of file structuredMeshElement.h.

Referenced by coord(), and globalID().

◆ d_meshType

GeomType AMP::Mesh::structuredMeshElement::d_meshType
protected

Definition at line 92 of file structuredMeshElement.h.

◆ d_physicalDim

unsigned char AMP::Mesh::structuredMeshElement::d_physicalDim
protected

Definition at line 93 of file structuredMeshElement.h.

Referenced by coord().


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