1#ifndef included_AMP_structuredMeshElement
2#define included_AMP_structuredMeshElement
4#include "AMP/mesh/structured/BoxMesh.h"
60 inline std::string
elementClass()
const override {
return "structuredMeshElement"; }
80 void getVertices( std::vector<Point> &vertices )
const override;
89 std::unique_ptr<MeshElement>
clone()
const override;
99 std::array<int8_t, 3>
getBC()
const;
Structure to uniquely identify an element.
A class used to represent a logically rectangular box mesh.
virtual void coord(const MeshElementIndex &index, double *pos) const =0
Return a mesh element's coordinates given it's id.
MeshElementID convert(const MeshElementIndex &id) const
Convert the MeshElementIndex to the MeshElementID.
A pointer class to wrap a MeshElementVector.
virtual ElementListPtr getElements(const GeomType type) const
Return the elements composing the current element.
virtual ElementListPtr getNeighbors() const
constexpr TYPE * data() noexcept
constexpr void setNdim(uint8_t N)
A derived class used to define a mesh element.
BoxMesh::MeshElementIndex d_index
structuredMeshElement(const structuredMeshElement &)
Copy constructor.
Point centroid() const override
Return the centroid of the element.
ElementListPtr getElements(const GeomType) const override
Return the elements composing the current element.
void reset(const BoxMesh::MeshElementIndex &index, const AMP::Mesh::BoxMesh *mesh)
Reset the internal data to the given element.
void getVertices(std::vector< Point > &vertices) const override
MeshPoint< double > nearest(const MeshPoint< double > &pos) const override
Calculate the nearest point on the element.
structuredMeshElement()
Empty constructor for a MeshElement.
virtual ~structuredMeshElement()
De-constructor for a MeshElement.
structuredMeshElement(const BoxMesh::MeshElementIndex &index, const AMP::Mesh::BoxMesh *mesh)
std::unique_ptr< MeshElement > clone() const override
Clone the element.
int getElementsID(const GeomType, MeshElementID *) const override
Return the IDs of the elements composing the current element.
int getNeighborIndex(BoxMesh::MeshElementIndex *index) const
ElementListPtr getParents(GeomType type) const
Get the parents of the given element.
const auto & getIndex() const
Return the index of the element.
std::string elementClass() const override
Return the element class.
bool isOnSurface() const override
Check if the element is on the surface.
unsigned char d_physicalDim
MeshElementID globalID() const override
Return the unique global ID of the element.
double distance(const MeshPoint< double > &pos, const MeshPoint< double > &dir) const override
Calculate the distance to the element given a ray.
const typeID & getTypeID() const override
Return the typeID of the underlying element.
void reset(const BoxMesh::MeshElementIndex &index)
structuredMeshElement & operator=(const structuredMeshElement &)
Assignment operator.
void reset()
Reset the internal data to an empty element.
std::array< int8_t, 3 > getBC() const
const AMP::Mesh::BoxMesh * d_mesh
Point coord() const override final
Return the coordinates of the vertex (only applies to vertices)
bool isOnBoundary(int id) const override
Check if the current element is on the given boundary.
bool containsPoint(const Point &pos, double TOL=1e-12) const override
Return true if the element contains the point.
ElementListPtr getNeighbors() const override
double volume() const override
Return the volume of the current element (does not apply to vertices)
bool isInBlock(int id) const override
Check if the current element is in the given block.
void getElementIndex(const GeomType type, int &N, BoxMesh::MeshElementIndex *index) const
Point norm() const override
Return the normal to the current element (does not apply to all elements)
GeomType
Enumeration for basic mesh-based quantities.
A structure used to identify the mesh element.
Class to store type info.