OGS
HexRule20.cpp
Go to the documentation of this file.
1
11#include "HexRule20.h"
12
13#include <array>
14
15#include "BaseLib/Logging.h"
16#include "Line.h"
17#include "MeshLib/Node.h"
18#include "Quad.h"
19
20namespace MeshLib
21{
22
23const Element* HexRule20::getFace(const Element* e, unsigned i)
24{
25 if (i < n_faces)
26 {
27 std::array<Node*, 8> nodes{};
28 for (unsigned j = 0; j < 8; j++)
29 {
30 nodes[j] = const_cast<Node*>(e->getNode(face_nodes[i][j]));
31 }
32 return new Quad8(nodes, e->getID());
33 }
34 ERR("Error in MeshLib::Element::getFace() - Index {:d} does not exist.", i);
35 return nullptr;
36}
37
38} // 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 constexpr const unsigned face_nodes[6][8]
Constant: Local node index table for faces.
Definition HexRule20.h:54
static const Element * getFace(const Element *e, unsigned i)
Returns the i-th face of the element.
Definition HexRule20.cpp:23
static const unsigned n_faces
Constant: The number of faces.
Definition HexRule.h:29
TemplateElement< MeshLib::QuadRule8 > Quad8
Definition Quad.h:29