OGS
HexRule8.cpp
Go to the documentation of this file.
1
11#include "HexRule8.h"
12
13#include <array>
14
15#include "BaseLib/Logging.h"
16#include "Line.h"
18#include "MeshLib/Node.h"
19#include "Quad.h"
20
21namespace MeshLib
22{
23const Element* HexRule8::getFace(const Element* e, unsigned i)
24{
25 if (i < n_faces)
26 {
27 std::array<Node*, 4> nodes{};
28 for (unsigned j = 0; j < 4; j++)
29 {
30 nodes[j] = const_cast<Node*>(e->getNode(face_nodes[i][j]));
31 }
32 return new Quad(nodes, e->getID());
33 }
34 ERR("Error in MeshLib::Element::getFace() - Index {:d} does not exist.", i);
35 return nullptr;
36}
37} // end namespace MeshLib
Definition of the Line class.
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:45
Definition of the Node class.
Definition of the Quad class.
virtual const Node * getNode(unsigned idx) const =0
std::size_t getID() const
Returns the ID of the element.
Definition Element.h:91
static const Element * getFace(const Element *e, unsigned i)
Returns the i-th face of the element.
Definition HexRule8.cpp:23
static constexpr const unsigned face_nodes[6][4]
Constant: Local node index table for faces.
Definition HexRule8.h:53
static const unsigned n_faces
Constant: The number of faces.
Definition HexRule.h:29
TemplateElement< MeshLib::QuadRule4 > Quad
Definition Quad.h:28