OGS
CellRule.h
Go to the documentation of this file.
1
11#pragma once
12
13#include "MeshLib/Node.h"
14
15namespace MeshLib
16{
17
18class Element;
19
21{
22public:
24 static const unsigned dimension = 3u;
25
34 static bool testElementNodeOrder(Element const& e);
35
36protected:
38 template <typename ElementRule>
39 static unsigned identifyFace(Node const* const* element_nodes,
40 Node const* nodes[ElementRule::dimension])
41 {
42 for (unsigned i = 0; i < ElementRule::n_faces; i++)
43 {
44 unsigned flag(0);
45 constexpr std::size_t n = sizeof(ElementRule::face_nodes[0]) /
46 sizeof(ElementRule::face_nodes[0][0]);
47 for (unsigned j = 0; j < n; j++)
48 {
49 for (unsigned k = 0; k < ElementRule::dimension; k++)
50 {
51 if (ElementRule::face_nodes[i][j] != 99 &&
52 element_nodes[ElementRule::face_nodes[i][j]] ==
53 nodes[k])
54 {
55 flag++;
56 }
57 }
58 }
59 if (flag == ElementRule::dimension)
60 {
61 return i;
62 }
63 }
64 return std::numeric_limits<unsigned>::max();
65 }
66}; /* class */
67
68} // namespace MeshLib
Definition of the Node class.
static unsigned identifyFace(Node const *const *element_nodes, Node const *nodes[ElementRule::dimension])
Returns the ID of a face given an array of nodes.
Definition CellRule.h:39
static const unsigned dimension
Constant: Dimension of this mesh element.
Definition CellRule.h:24
static bool testElementNodeOrder(Element const &e)
Definition CellRule.cpp:18