OGS
MeshLib::HexRule20 Class Reference

Detailed Description

A 20-nodes Hexahedron Element.

Hex:
14
7-----------6
/: /|
/ : / |
15/ : /13|
/ 19: / | 18
/ : 12 / |
4-----------5 |
| : | 10 |
| 3.....|.....2
| . | /
16 | . |17 /
|11. | / 9
| . | /
|. |/
0-----------1
8
TemplateElement< MeshLib::HexRule8 > Hex
Definition Hex.h:14

Definition at line 37 of file HexRule20.h.

#include <HexRule20.h>

Inheritance diagram for MeshLib::HexRule20:
[legend]
Collaboration diagram for MeshLib::HexRule20:
[legend]

Public Types

using EdgeReturn = MeshLib::QuadraticEdgeReturn
 Returns the i-th edge of the element.

Static Public Member Functions

static const ElementgetFace (const Element *e, unsigned i)
 Returns the i-th face of the element.
static unsigned identifyFace (Node const *const *element_nodes, Node const *nodes[3])
 Returns the ID of a face given an array of nodes.
Static Public Member Functions inherited from MeshLib::HexRule
static bool isPntInElement (Node const *const *nodes, MathLib::Point3d const &pnt, double eps)
static ElementErrorCode validate (const Element *e)
static double computeVolume (Node const *const *element_nodes)
Static Public Member Functions inherited from MeshLib::CellRule
static bool testElementNodeOrder (Element const &e)

Static Public Attributes

static const unsigned n_all_nodes = 20u
 Constant: The number of all nodes for this element.
static const CellType cell_type = CellType::HEX20
 Constant: The FEM type of the element.
static constexpr const unsigned face_nodes [6][8]
 Constant: Local node index table for faces.
static constexpr const unsigned edge_nodes [12][3]
 Constant: Local node index table for edge.
Static Public Attributes inherited from MeshLib::HexRule
static const unsigned n_base_nodes = 8u
 Constant: The number of base nodes for this element.
static const MeshElemType mesh_elem_type = MeshElemType::HEXAHEDRON
 Constant: The geometric type of the element.
static const unsigned n_faces = 6
 Constant: The number of faces.
static const unsigned n_edges = 12
 Constant: The number of edges.
static const unsigned n_neighbors = 6
 Constant: The number of neighbors.
Static Public Attributes inherited from MeshLib::CellRule
static const unsigned dimension = 3u
 Constant: Dimension of this mesh element.

Additional Inherited Members

Static Protected Member Functions inherited from MeshLib::CellRule
template<typename ElementRule>
static unsigned identifyFace (Node const *const *element_nodes, Node const *nodes[ElementRule::dimension])
 Returns the ID of a face given an array of nodes.

Member Typedef Documentation

◆ EdgeReturn

Returns the i-th edge of the element.

Definition at line 73 of file HexRule20.h.

Member Function Documentation

◆ getFace()

const Element * MeshLib::HexRule20::getFace ( const Element * e,
unsigned i )
static

Returns the i-th face of the element.

Definition at line 16 of file HexRule20.cpp.

17{
18 if (i < n_faces)
19 {
20 std::array<Node*, 8> nodes{};
21 for (unsigned j = 0; j < 8; j++)
22 {
23 nodes[j] = const_cast<Node*>(e->getNode(face_nodes[i][j]));
24 }
25 return new Quad8(nodes, e->getID());
26 }
27 ERR("Error in MeshLib::Element::getFace() - Index {:d} does not exist.", i);
28 return nullptr;
29}
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:40
static constexpr const unsigned face_nodes[6][8]
Constant: Local node index table for faces.
Definition HexRule20.h:47
static const unsigned n_faces
Constant: The number of faces.
Definition HexRule.h:22
TemplateElement< MeshLib::QuadRule8 > Quad8
Definition Quad.h:18

References ERR(), face_nodes, MeshLib::Element::getID(), MeshLib::Element::getNode(), and MeshLib::HexRule::n_faces.

◆ identifyFace()

unsigned MeshLib::HexRule20::identifyFace ( Node const *const * element_nodes,
Node const * nodes[3] )
inlinestatic

Returns the ID of a face given an array of nodes.

Definition at line 79 of file HexRule20.h.

81 {
82 return CellRule::identifyFace<HexRule20>(element_nodes, nodes);
83 }
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

References MeshLib::CellRule::identifyFace().

Member Data Documentation

◆ cell_type

const CellType MeshLib::HexRule20::cell_type = CellType::HEX20
static

Constant: The FEM type of the element.

Definition at line 44 of file HexRule20.h.

◆ edge_nodes

const unsigned MeshLib::HexRule20::edge_nodes[12][3]
staticconstexpr
Initial value:
= {
{0, 1, 8},
{1, 2, 9},
{2, 3, 10},
{0, 3, 11},
{4, 5, 12},
{5, 6, 13},
{6, 7, 14},
{4, 7, 15},
{0, 4, 16},
{1, 5, 17},
{2, 6, 18},
{3, 7, 19}
}

Constant: Local node index table for edge.

Definition at line 57 of file HexRule20.h.

57 {
58 {0, 1, 8}, // Edge 0
59 {1, 2, 9}, // Edge 1
60 {2, 3, 10}, // Edge 2
61 {0, 3, 11}, // Edge 3
62 {4, 5, 12}, // Edge 4
63 {5, 6, 13}, // Edge 5
64 {6, 7, 14}, // Edge 6
65 {4, 7, 15}, // Edge 7
66 {0, 4, 16}, // Edge 8
67 {1, 5, 17}, // Edge 9
68 {2, 6, 18}, // Edge 10
69 {3, 7, 19} // Edge 11
70 };

◆ face_nodes

const unsigned MeshLib::HexRule20::face_nodes[6][8]
staticconstexpr
Initial value:
= {
{0, 3, 2, 1, 11, 10, 9, 8},
{0, 1, 5, 4, 8, 17, 12, 16},
{1, 2, 6, 5, 9, 18, 13, 17},
{2, 3, 7, 6, 10, 19, 14, 18},
{3, 0, 4, 7, 11, 16, 15, 19},
{4, 5, 6, 7, 12, 13, 14, 15}
}

Constant: Local node index table for faces.

Definition at line 47 of file HexRule20.h.

47 {
48 {0, 3, 2, 1, 11, 10, 9, 8}, // Face 0
49 {0, 1, 5, 4, 8, 17, 12, 16}, // Face 1
50 {1, 2, 6, 5, 9, 18, 13, 17}, // Face 2
51 {2, 3, 7, 6, 10, 19, 14, 18}, // Face 3
52 {3, 0, 4, 7, 11, 16, 15, 19}, // Face 4
53 {4, 5, 6, 7, 12, 13, 14, 15} // Face 5
54 };

Referenced by getFace().

◆ n_all_nodes

const unsigned MeshLib::HexRule20::n_all_nodes = 20u
static

Constant: The number of all nodes for this element.

Definition at line 41 of file HexRule20.h.


The documentation for this class was generated from the following files: