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>
44 :
Element(e.getID()), _nodes{e._nodes}
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>
91 for (
unsigned i(0); i<getNumberOfEdges(); i++)
101template <
class ELEMENT_RULE>
105 if (idx >= getNumberOfNodes())
107 ERR(
"Error in MeshLib::TemplateElement::getNode() - Index {:d} in {:s}",
115template <
class ELEMENT_RULE>
119 if (idx >= getNumberOfNodes())
121 ERR(
"Error in MeshLib::TemplateElement::getNode() - Index {:d} in {:s}",
129template <
class ELEMENT_RULE>
133 if (idx < getNumberOfNodes())
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
constexpr std::span< Node *const > nodes() const
Span of element's nodes, their pointers actually.
unsigned space_dimension_
Dimension of the space, where the element exists.
std::array< Node *, n_all_nodes > _nodes
bool isEdge(unsigned idx1, unsigned idx2) const override
Returns true if these two indices form an edge and false otherwise.
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.
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.