OGS
TetRule4.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6#include "EdgeReturn.h"
7#include "Element.h"
8#include "TetRule.h"
9
10namespace MeshLib
11{
12
34class TetRule4 : public TetRule
35{
36public:
38 static const unsigned n_all_nodes = 4u;
39
42
44 constexpr static const unsigned face_nodes[4][3] = {
45 {0, 2, 1}, // Face 0
46 {0, 1, 3}, // Face 1
47 {1, 2, 3}, // Face 2
48 {2, 0, 3} // Face 3
49 };
50
52 constexpr static const unsigned edge_nodes[6][2] = {
53 {0, 1}, // Edge 0
54 {1, 2}, // Edge 1
55 {0, 2}, // Edge 2
56 {0, 3}, // Edge 3
57 {1, 3}, // Edge 4
58 {2, 3} // Edge 5
59 };
60
63
65 static const Element* getFace(const Element* e, unsigned i);
66
68 static unsigned identifyFace(Node const* const* element_nodes,
69 Node const* nodes[3])
70 {
71 return CellRule::identifyFace<TetRule4>(element_nodes, nodes);
72 }
73}; /* class */
74
75} // namespace MeshLib
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:32
Returns linear order edge.
Definition EdgeReturn.h:24
static constexpr const unsigned face_nodes[4][3]
Constant: Local node index table for faces.
Definition TetRule4.h:44
static const CellType cell_type
Constant: The FEM type of the element.
Definition TetRule4.h:41
MeshLib::LinearEdgeReturn EdgeReturn
Returns the i-th edge of the element.
Definition TetRule4.h:62
static unsigned identifyFace(Node const *const *element_nodes, Node const *nodes[3])
Returns the ID of a face given an array of nodes.
Definition TetRule4.h:68
static const Element * getFace(const Element *e, unsigned i)
Returns the i-th face of the element.
Definition TetRule4.cpp:14
static constexpr const unsigned edge_nodes[6][2]
Constant: Local node index table for edge.
Definition TetRule4.h:52
static const unsigned n_all_nodes
Constant: The number of all nodes for this element.
Definition TetRule4.h:38
CellType
Types of mesh elements supported by OpenGeoSys.
Definition MeshEnums.h:53