15template <
class ELEMENT_RULE>
29template <
class ELEMENT_RULE>
31 std::array<Node*, n_all_nodes>
const&
nodes, std::size_t
id)
41template <
class ELEMENT_RULE>
47 for (
unsigned i = 0; i < ELEMENT_RULE::n_neighbors; i++)
55template <
class ELEMENT_RULE>
58 return ELEMENT_RULE::computeVolume(
_nodes.data());
65bool isEdge(
unsigned const (&edge_nodes)[N],
unsigned idx1,
unsigned idx2)
67 if (edge_nodes[0] == idx1 && edge_nodes[1] == idx2)
71 if (edge_nodes[1] == idx1 && edge_nodes[0] == idx2)
80isEdge(
unsigned const (&)[1],
unsigned ,
unsigned )
88template <
class ELEMENT_RULE>
101template <
class ELEMENT_RULE>
107 ERR(
"Error in MeshLib::TemplateElement::getNode() - Index {:d} in {:s}",
115template <
class ELEMENT_RULE>
121 ERR(
"Error in MeshLib::TemplateElement::getNode() - Index {:d} in {:s}",
129template <
class ELEMENT_RULE>
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
constexpr std::span< Node *const > nodes() const
Span of element's nodes, their pointers actually.
std::size_t getID() const
Returns the ID of the element.
unsigned space_dimension_
Dimension of the space, where the element exists.
std::array< Node *, n_all_nodes > _nodes
unsigned getNumberOfNodes() const override
Get the number of all nodes for this element.
bool isEdge(unsigned idx1, unsigned idx2) const override
Returns true if these two indices form an edge and false otherwise.
MeshElemType getGeomType() const override
Get the type of this element.
static const unsigned n_all_nodes
Constant: The number of all nodes for this element.
void setNode(unsigned idx, Node *node) override
TemplateElement(Node *nodes[n_all_nodes], std::size_t id=std::numeric_limits< std::size_t >::max())
double getContent() const override final
Returns the length, area or volume of a 1D, 2D or 3D element.
unsigned getNumberOfEdges() const override
Get the number of edges for this element.
const Node * getNode(unsigned idx) const override
bool isEdge(unsigned const (&edge_nodes)[N], unsigned idx1, unsigned idx2)
std::string MeshElemType2String(const MeshElemType t)
Given a MeshElemType this returns the appropriate string.