72 constexpr std::span<Node* const>
nodes()
const
131 virtual bool isEdge(
unsigned i,
unsigned j)
const = 0;
142 double eps = std::numeric_limits<double>::epsilon())
const = 0;
195 explicit Element(std::size_t
id);
Definition of ElementErrorCodes.
Definition of mesh-related Enumerations.
Definition of the Mesh class.
Definition of the Point3d class.
Collects error flags for mesh elements.
virtual MeshElemType getGeomType() const =0
void setNeighbor(Element *neighbor, unsigned const face_id)
virtual ~Element()
Destructor.
virtual const Element * getEdge(unsigned i) const =0
Returns the i-th edge of the element.
friend std::ostream & operator<<(std::ostream &os, Element const &e)
virtual CellType getCellType() const =0
virtual bool isPntInElement(MathLib::Point3d const &pnt, double eps=std::numeric_limits< double >::epsilon()) const =0
virtual unsigned getNumberOfNodes() const =0
virtual ElementErrorCode validate() const =0
virtual Node * getNode(unsigned idx)=0
virtual Element * clone() const =0
virtual double getContent() const =0
Returns the length, area or volume of a 1D, 2D or 3D element.
virtual double computeVolume()=0
void setID(std::size_t id)
Sets the element ID.
virtual unsigned getNumberOfBoundaries() const =0
virtual unsigned getNumberOfFaces() const =0
Get the number of faces for this element.
virtual const Element * getFace(unsigned i) const =0
Returns the i-th face of the element.
virtual unsigned getNumberOfBaseNodes() const =0
virtual bool isBoundaryElement() const
virtual bool testElementNodeOrder() const =0
virtual const Node * getNode(unsigned idx) const =0
virtual unsigned getNumberOfNeighbors() const =0
Get the number of neighbors for this element.
virtual void setNode(unsigned idx, Node *node)=0
virtual unsigned getNumberOfEdges() const =0
Get the number of edges for this element.
virtual bool isEdge(unsigned i, unsigned j) const =0
Returns true if these two indices form an edge and false otherwise.
virtual constexpr unsigned getDimension() const =0
Get dimension of the mesh element.
virtual Element * clone(Node **nodes, std::size_t id) const =0
std::optional< unsigned > addNeighbor(Element *e)
Tries to add an element e as neighbour to this element. If the elements really are neighbours,...
constexpr std::span< Node *const > nodes() const
Span of element's nodes, their pointers actually.
virtual Node *const * getNodes() const =0
Get array of element nodes.
std::size_t getID() const
Returns the ID of the element.
virtual const Element * getNeighbor(unsigned i) const =0
Get the specified neighbor.
unsigned space_dimension_
Dimension of the space, where the element exists.
virtual Node * getEdgeNode(unsigned edge_id, unsigned node_id) const =0
Return a specific edge node.
virtual const Element * getBoundary(unsigned i) const =0
virtual unsigned identifyFace(Node const *nodes[3]) const =0
Returns the ID of a face given an array of nodes.
std::pair< double, double > computeSqrNodeDistanceRange(MeshLib::Element const &element, bool const check_allnodes)
Compute the minimum and maximum node distances for this element.
CellType
Types of mesh elements supported by OpenGeoSys.
bool isPointInElementXY(MathLib::Point3d const &p, Element const &e)
bool hasZeroVolume(MeshLib::Element const &element)
Returns true if the element has zero length/area/volume.
std::pair< double, double > computeSqrEdgeLengthRange(Element const &element)
Compute the minimum and maximum squared edge length for this element.
std::size_t getNodeIndex(Element const &element, unsigned const idx)
unsigned getNodeIDinElement(Element const &element, const MeshLib::Node *node)
Returns the position of the given node in the node array of this element.
MathLib::Point3d getCenterOfGravity(Element const &element)
Calculates the center of gravity for the mesh element.
bool areNeighbors(Element const *const element, Element const *const other)
Returns true if elem is a neighbour of this element and false otherwise.
MeshElemType
Types of mesh elements supported by OpenGeoSys. Values are from VTKCellType enum.