OGS
PrismRule15.cpp
Go to the documentation of this file.
1
11#include "PrismRule15.h"
12
13#include "BaseLib/Logging.h"
14#include "MeshLib/Node.h"
15#include "Quad.h"
16#include "Tri.h"
17
18namespace MeshLib
19{
20const unsigned PrismRule15::n_face_nodes[5] = {6, 8, 8, 8, 6};
21
22const Element* PrismRule15::getFace(const Element* e, unsigned i)
23{
24 if (i < n_faces)
25 {
26 unsigned nFaceNodes(PrismRule15::n_face_nodes[i]);
27 auto** nodes = new Node*[nFaceNodes];
28 for (unsigned j = 0; j < nFaceNodes; j++)
29 {
30 nodes[j] = const_cast<Node*>(e->getNode(face_nodes[i][j]));
31 }
32
33 if (i == 0 || i == 4)
34 {
35 return new Tri6(nodes, e->getID());
36 }
37
38 return new Quad8(nodes);
39 }
40 ERR("Error in MeshLib::Element::getFace() - Index {:d} does not exist.", i);
41 return nullptr;
42}
43
44} // end namespace MeshLib
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:45
Definition of the Node class.
Definition of the Quad class.
Definition of the Tri 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[5][8]
Constant: Local node index table for faces.
Definition PrismRule15.h:54
static const Element * getFace(const Element *e, unsigned i)
Returns the i-th face of the element.
static const unsigned n_face_nodes[5]
Constant: Table for the number of nodes for each face.
Definition PrismRule15.h:76
static const unsigned n_faces
Constant: The number of faces.
Definition PrismRule.h:29
TemplateElement< MeshLib::QuadRule8 > Quad8
Definition Quad.h:29
TemplateElement< MeshLib::TriRule6 > Tri6
Definition Tri.h:27