OGS
MeshLib::HexRule Class Reference

Detailed Description

Definition at line 19 of file HexRule.h.

#include <HexRule.h>

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

Static Public Member Functions

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_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 Function Documentation

◆ computeVolume()

double MeshLib::HexRule::computeVolume ( Node const *const * element_nodes)
static

Calculates the volume of a convex hexahedron by partitioning it into six tetrahedra.

Definition at line 18 of file HexRule.cpp.

19{
20 return MathLib::calcTetrahedronVolume(*element_nodes[4],
21 *element_nodes[7],
22 *element_nodes[5],
23 *element_nodes[0]) +
24 MathLib::calcTetrahedronVolume(*element_nodes[5],
25 *element_nodes[3],
26 *element_nodes[1],
27 *element_nodes[0]) +
28 MathLib::calcTetrahedronVolume(*element_nodes[5],
29 *element_nodes[7],
30 *element_nodes[3],
31 *element_nodes[0]) +
32 MathLib::calcTetrahedronVolume(*element_nodes[5],
33 *element_nodes[7],
34 *element_nodes[6],
35 *element_nodes[2]) +
36 MathLib::calcTetrahedronVolume(*element_nodes[1],
37 *element_nodes[3],
38 *element_nodes[5],
39 *element_nodes[2]) +
40 MathLib::calcTetrahedronVolume(*element_nodes[3],
41 *element_nodes[7],
42 *element_nodes[5],
43 *element_nodes[2]);
44}
double calcTetrahedronVolume(MathLib::Point3d const &a, MathLib::Point3d const &b, MathLib::Point3d const &c, MathLib::Point3d const &d)

References MathLib::calcTetrahedronVolume().

◆ isPntInElement()

bool MeshLib::HexRule::isPntInElement ( Node const *const * nodes,
MathLib::Point3d const & pnt,
double eps )
static

Checks if a point is inside the element.

Parameters
pnta 3D MathLib::Point3d object
epstolerance for numerical algorithm used or computing the property
Returns
true if the point is not outside the element, false otherwise
Parameters
nodesthe nodes of the element.

Definition at line 46 of file HexRule.cpp.

49{
51 pnt, *nodes[4], *nodes[7], *nodes[5], *nodes[0], eps) ||
53 pnt, *nodes[5], *nodes[3], *nodes[1], *nodes[0], eps) ||
55 pnt, *nodes[5], *nodes[7], *nodes[3], *nodes[0], eps) ||
57 pnt, *nodes[5], *nodes[7], *nodes[6], *nodes[2], eps) ||
59 pnt, *nodes[1], *nodes[3], *nodes[5], *nodes[2], eps) ||
61 pnt, *nodes[3], *nodes[7], *nodes[5], *nodes[2], eps));
62}
bool isPointInTetrahedron(MathLib::Point3d const &p, MathLib::Point3d const &a, MathLib::Point3d const &b, MathLib::Point3d const &c, MathLib::Point3d const &d, double eps)

References MathLib::isPointInTetrahedron().

◆ validate()

ElementErrorCode MeshLib::HexRule::validate ( const Element * e)
static

Tests if the element is geometrically valid.

Definition at line 64 of file HexRule.cpp.

65{
66 ElementErrorCode error_code;
68
69 for (unsigned i = 0; i < 6; ++i)
70 {
71 if (error_code.all())
72 {
73 break;
74 }
75
76 const MeshLib::Element* quad(e->getFace(i));
77 error_code |= quad->validate();
78 delete quad;
79 }
80 error_code[ElementErrorFlag::NodeOrder] = !e->testElementNodeOrder();
81 return error_code;
82}
Collects error flags for mesh elements.
bool hasZeroVolume(MeshLib::Element const &element)
Returns true if the element has zero length/area/volume.
Definition Element.cpp:119

References MeshLib::Element::getFace(), MeshLib::hasZeroVolume(), NodeOrder, MeshLib::Element::testElementNodeOrder(), MeshLib::Element::validate(), and ZeroVolume.

Member Data Documentation

◆ mesh_elem_type

const MeshElemType MeshLib::HexRule::mesh_elem_type = MeshElemType::HEXAHEDRON
static

Constant: The geometric type of the element.

Definition at line 26 of file HexRule.h.

◆ n_base_nodes

const unsigned MeshLib::HexRule::n_base_nodes = 8u
static

Constant: The number of base nodes for this element.

Definition at line 23 of file HexRule.h.

◆ n_edges

const unsigned MeshLib::HexRule::n_edges = 12
static

Constant: The number of edges.

Definition at line 32 of file HexRule.h.

◆ n_faces

const unsigned MeshLib::HexRule::n_faces = 6
static

Constant: The number of faces.

Definition at line 29 of file HexRule.h.

Referenced by MeshLib::HexRule20::getFace(), and MeshLib::HexRule8::getFace().

◆ n_neighbors

const unsigned MeshLib::HexRule::n_neighbors = 6
static

Constant: The number of neighbors.

Definition at line 35 of file HexRule.h.


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