1#ifndef included_AMP_MeshElement
2#define included_AMP_MeshElement
4#include "AMP/mesh/MeshElementVector.h"
5#include "AMP/mesh/MeshID.h"
6#include "AMP/utils/MeshPoint.h"
7#include "AMP/utils/typeid.h"
61 inline double coord(
int i )
const {
return coord()[i]; }
72 bool containsPoint(
const std::vector<double> &pos,
double TOL = 1e-12 )
const;
80 std::string
print( uint8_t indent = 0 )
const;
193 virtual std::unique_ptr<MeshElement>
clone()
const;
A pointer class to wrap a MeshElementVector.
virtual MeshElementID globalID() const
Return the unique global ID of the element.
bool operator!=(const MeshElement &rhs) const
bool operator<=(const MeshElement &rhs) const
bool operator<(const MeshElementID &rhs) const
virtual bool isOnSurface() const
Check if the element is on the surface.
virtual void getNeighborVertices(std::vector< Point > &vertices) const
virtual Point centroid() const
Return the centroid of the element.
bool operator>(const MeshElement &rhs) const
virtual Point nearest(const Point &pos) const
Calculate the nearest point on the element.
virtual double distance(const Point &pos, const Point &dir) const
Calculate the distance to the element given a ray.
std::string print(uint8_t indent=0) const
Print info about the element.
bool operator!=(const MeshElementID &rhs) const
virtual Point coord() const
Return the coordinates of the vertex (only applies to vertices)
bool operator>=(const MeshElement &rhs) const
bool operator>(const MeshElementID &rhs) const
virtual std::string elementClass() const
Return the element class.
virtual std::unique_ptr< MeshElement > clone() const
Clone the element.
bool containsPoint(const std::vector< double > &pos, double TOL=1e-12) const
Return true if the element contains the point.
virtual int getElementsID(const GeomType type, MeshElementID *ID) const
Return the IDs of the elements composing the current element.
GeomType elementType() const
Return the element type.
virtual double volume() const
Return the volume of the current element (does not apply to vertices)
MeshElement & operator=(MeshElement &&)=default
bool operator>=(const MeshElementID &rhs) const
virtual ElementListPtr getElements(const GeomType type) const
Return the elements composing the current element.
virtual ElementListPtr getNeighbors() const
virtual bool isOnBoundary(int id) const
Check if the current element is on the given boundary.
bool isNull() const
Is the mesh element null.
virtual const typeID & getTypeID() const
Return the typeID of the underlying element.
virtual bool containsPoint(const Point &pos, double TOL=1e-12) const
Return true if the element contains the point.
unsigned int globalOwnerRank(const Mesh &mesh) const
Return the owner rank according to AMP_COMM_WORLD.
virtual void getVertices(std::vector< Point > &vertices) const
bool operator==(const MeshElement &rhs) const
virtual bool isInBlock(int id) const
Check if the current element is in the given block.
bool operator==(const MeshElementID &rhs) const
virtual ~MeshElement()=default
Destructor for a MeshElement.
MeshElement()=default
Empty constructor for a MeshElement.
bool operator<(const MeshElement &rhs) const
double coord(int i) const
Return the coordinate of the vertex.
bool operator<=(const MeshElementID &rhs) const
MeshElement(const MeshElement &)=default
MeshElement & operator=(const MeshElement &)=default
MeshElement(MeshElement &&)=default
virtual Point norm() const
Return the normal to the current element (does not apply to all elements)
A class used to abstract away mesh from an application.
GeomType
Enumeration for basic mesh-based quantities.
A structure used to identify the mesh element.
constexpr GeomType type() const
constexpr bool isNull() const
Class to store type info.