Advanced Multi-Physics (AMP)
On-Line Documentation
libmeshMeshElement.h
Go to the documentation of this file.
1#ifndef included_AMP_libmeshMeshElement
2#define included_AMP_libmeshMeshElement
3
4
5#include "AMP/mesh/MeshElement.h"
6#include "AMP/mesh/libmesh/libmeshMesh.h"
7
8#include <memory>
9#include <vector>
10
11// libMesh includes
12#include "libmesh/libmesh_config.h"
13#undef LIBMESH_ENABLE_REFERENCE_COUNTING
14#include "libmesh/elem.h"
15
16
17namespace AMP::Mesh {
18
19
20class libmeshMesh;
21class libmeshElemIterator;
22class libmeshNodeIterator;
23
24
32class libmeshMeshElement final : public MeshElement
33{
34public:
37
40
43
46
48 MeshElementID globalID() const override { return d_globalID; }
49
51 const typeID &getTypeID() const override;
52
54 inline std::string elementClass() const override { return "libmeshMeshElement"; }
55
57 ElementListPtr getElements( const GeomType type ) const override;
58
60 int getElementsID( const GeomType type, MeshElementID *ID ) const override;
61
63 ElementListPtr getNeighbors() const override;
64
66 double volume() const override;
67
69 Point norm() const override;
70
72 Point coord() const override;
73
80 Point centroid() const override;
81
90 bool containsPoint( const Point &pos, double TOL = 1e-12 ) const override;
91
93 bool isOnSurface() const override;
94
100 bool isOnBoundary( int id ) const override;
101
107 bool isInBlock( int id ) const override;
108
110 const void *get() const { return ptr_element; }
111
112
113public:
123 GeomType type,
124 void *element,
125 unsigned int rank,
126 MeshID meshID,
127 const libmeshMesh *mesh );
129 GeomType type,
130 std::shared_ptr<libMesh::Elem> element,
131 unsigned int rank,
132 MeshID meshID,
133 const libmeshMesh *mesh );
134
136 std::unique_ptr<MeshElement> clone() const override;
137
138
139protected: // Internal data
140 int d_dim; // The dimension of the mesh
141 unsigned int d_rank; // The rank of the current processor
142 void *ptr_element; // The underlying libmesh element properties (raw pointer)
143 std::shared_ptr<libMesh::Elem> ptr2; // Optional smart pointer to the element (to hold a copy)
144 const libmeshMesh *d_mesh; // The pointer to the current mesh
145 MeshID d_meshID; // The ID of the current mesh
146 bool d_delete_elem; // Do we need to delete the libMesh element
148};
149
150
151} // namespace AMP::Mesh
152
153#endif
A pointer class to wrap a MeshElementVector.
A derived class used to define a mesh element.
bool isInBlock(int id) const override
Check if the current element is in the given block.
virtual ~libmeshMeshElement()
De-constructor for a MeshElement.
Point centroid() const override
Return the centroid of the element.
const typeID & getTypeID() const override
Return the typeID of the underlying element.
MeshElementID globalID() const override
Return the unique global ID of the element.
Point norm() const override
Return the normal to the current element (does not apply to all elements)
libmeshMeshElement(int dim, GeomType type, void *element, unsigned int rank, MeshID meshID, const libmeshMesh *mesh)
bool containsPoint(const Point &pos, double TOL=1e-12) const override
Return true if the element contains the point.
std::shared_ptr< libMesh::Elem > ptr2
Point coord() const override
Return the coordinates of all vertices composing the element.
libmeshMeshElement(int dim, GeomType type, std::shared_ptr< libMesh::Elem > element, unsigned int rank, MeshID meshID, const libmeshMesh *mesh)
ElementListPtr getNeighbors() const override
Return the elements neighboring the current element.
int getElementsID(const GeomType type, MeshElementID *ID) const override
Return the IDs of the elements composing the current element.
ElementListPtr getElements(const GeomType type) const override
Return the elements composing the current element.
bool isOnSurface() const override
Check if the element is on the surface.
bool isOnBoundary(int id) const override
Check if the current element is on the given boundary.
const void * get() const
Return the raw pointer to the element/node (if it exists)
double volume() const override
Return the volume of the current element (does not apply to vertices)
std::unique_ptr< MeshElement > clone() const override
Clone the iterator.
libmeshMeshElement()
Empty constructor for a MeshElement.
libmeshMeshElement & operator=(const libmeshMeshElement &)
Assignment operator.
libmeshMeshElement(const libmeshMeshElement &)
Copy constructor.
std::string elementClass() const override
Return the element class.
A concrete mesh class for libMesh.
Definition libmeshMesh.h:46
GeomType
Enumeration for basic mesh-based quantities.
Definition MeshID.h:12
A structure used to identify the mesh element.
Definition MeshID.h:156
A structure used to identify the mesh.
Definition MeshID.h:31
Class to store type info.
Definition typeid.h:210



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:40.
Comments on this page