Advanced Multi-Physics (AMP)
On-Line Documentation
TriangleMeshElement.h
Go to the documentation of this file.
1#ifndef included_AMP_TriangleMeshElement
2#define included_AMP_TriangleMeshElement
3
4
5#include "AMP/mesh/MeshElement.h"
6#include <memory>
7#include <vector>
8
9
10namespace AMP::Mesh {
11
12
13template<uint8_t NG>
14class TriangleMesh;
15
16
25template<uint8_t NG>
26class TriangleMeshElement final : public MeshElement
27{
28public:
31
34
37
40
43
45 virtual ~TriangleMeshElement() = default;
46
48 MeshElementID globalID() const override { return d_globalID; }
49
51 std::string elementClass() const override;
52
54 ElementListPtr getElements( const GeomType type ) const override;
55
57 int getElementsID( const GeomType type, MeshElementID *ID ) const override;
58
60 ElementListPtr getNeighbors() const override;
61
63 double volume() const override;
64
66 MeshPoint<double> norm() const override;
67
69 MeshPoint<double> coord() const override;
70
77 MeshPoint<double> centroid() const override;
78
87 bool containsPoint( const MeshPoint<double> &pos, double TOL = 1e-12 ) const override;
88
94 MeshPoint<double> nearest( const MeshPoint<double> &pos ) const override;
95
104 virtual double distance( const MeshPoint<double> &pos,
105 const MeshPoint<double> &dir ) const override;
106
108 bool isOnSurface() const override;
109
115 bool isOnBoundary( int id ) const override;
116
122 bool isInBlock( int id ) const override;
123
125 const typeID &getTypeID() const override;
126
127
128public: // Advanced interfaces
129 // Default constructors
131
132 // Reset the element data
133 inline void resetElemId( const ElementID &id ) { d_globalID.resetElemID( id ); }
134
136 std::unique_ptr<MeshElement> clone() const override;
137
138
139private:
142};
143
144
145} // namespace AMP::Mesh
146
147#endif
A pointer class to wrap a MeshElementVector.
A derived class used to define a mesh element.
bool containsPoint(const MeshPoint< double > &pos, double TOL=1e-12) const override
Return true if the element contains the point.
void resetElemId(const ElementID &id)
MeshElementID globalID() const override
Return the unique global ID of the element.
TriangleMeshElement(const TriangleMeshElement &)
Copy constructor.
MeshPoint< double > centroid() const override
Return the centroid of the element.
ElementListPtr getNeighbors() const override
Return the elements neighboring the current element.
MeshPoint< double > coord() const override
Return the coordinates of all vertices composing the element.
TriangleMeshElement & operator=(TriangleMeshElement &&)
Move assignment operator.
bool isOnSurface() const override
Check if the element is on the surface.
double volume() const override
Return the volume of the current element (does not apply to vertices)
TriangleMeshElement & operator=(const TriangleMeshElement &)
Assignment operator.
bool isOnBoundary(int id) const override
Check if the current element is on the given boundary.
ElementListPtr getElements(const GeomType type) const override
Return the elements composing the current element.
MeshPoint< double > nearest(const MeshPoint< double > &pos) const override
Calculate the nearest point on the element.
TriangleMeshElement(TriangleMeshElement &&)
Move operator.
std::unique_ptr< MeshElement > clone() const override
Clone the iterator.
int getElementsID(const GeomType type, MeshElementID *ID) const override
Return the IDs of the elements composing the current element.
std::string elementClass() const override
Return the element class.
MeshPoint< double > norm() const override
Return the normal to the current element (does not apply to all elements)
virtual ~TriangleMeshElement()=default
De-constructor for a MeshElement.
bool isInBlock(int id) const override
Check if the current element is in the given block.
TriangleMeshElement(const MeshElementID &id, const TriangleMesh< NG > *mesh)
virtual double distance(const MeshPoint< double > &pos, const MeshPoint< double > &dir) const override
Calculate the distance to the element given a ray.
const TriangleMesh< NG > * d_mesh
const typeID & getTypeID() const override
Get the typeID.
TriangleMeshElement()
Empty constructor for a MeshElement.
A class used to represent an unstructured mesh of Triangles/Tetrahedrals.
GeomType
Enumeration for basic mesh-based quantities.
Definition MeshID.h:12
A structure used to identify an element within a mesh.
Definition MeshID.h:78
A structure used to identify the mesh element.
Definition MeshID.h:156
constexpr void resetElemID(ElementID elem_id)
Definition MeshID.h:170
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:41.
Comments on this page