OGS
MeshLib::FaceRule Class Reference

Detailed Description

Definition at line 18 of file FaceRule.h.

#include <FaceRule.h>

Inheritance diagram for MeshLib::FaceRule:
[legend]

Static Public Member Functions

static const ElementgetFace (const Element *e, unsigned i)
 Returns the face i of the element. More...
 
static bool testElementNodeOrder (Element const &e)
 
static Eigen::Vector3d getFirstSurfaceVector (Element const &e)
 
static Eigen::Vector3d getSecondSurfaceVector (Element const &e)
 
static Eigen::Vector3d getSurfaceNormal (Element const &e)
 Returns the surface normal of a 2D element. More...
 

Static Public Attributes

static const unsigned dimension = 2u
 Constant: Dimension of this mesh element. More...
 
static const unsigned n_faces = 0
 Constant: The number of faces. More...
 

Member Function Documentation

◆ getFace()

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

Returns the face i of the element.

Definition at line 25 of file FaceRule.h.

25 { return e->getEdge(i); }

References MeshLib::Element::getEdge().

◆ getFirstSurfaceVector()

Eigen::Vector3d MeshLib::FaceRule::getFirstSurfaceVector ( Element const &  e)
static
Returns
the first vector forming the surface' plane

Definition at line 24 of file FaceRule.cpp.

25 {
26  auto const a = Eigen::Map<Eigen::Vector3d const>(e.getNode(0)->getCoords());
27  auto const b = Eigen::Map<Eigen::Vector3d const>(e.getNode(1)->getCoords());
28  Eigen::Vector3d const v = a - b;
29  return v;
30 }

References MathLib::TemplatePoint< T, DIM >::getCoords(), and MeshLib::Element::getNode().

Referenced by getSurfaceNormal().

◆ getSecondSurfaceVector()

Eigen::Vector3d MeshLib::FaceRule::getSecondSurfaceVector ( Element const &  e)
static
Returns
the second vector forming the surface' plane

Definition at line 32 of file FaceRule.cpp.

33 {
34  auto const a = Eigen::Map<Eigen::Vector3d const>(e.getNode(1)->getCoords());
35  auto const b = Eigen::Map<Eigen::Vector3d const>(e.getNode(2)->getCoords());
36  Eigen::Vector3d const v = b - a;
37  return v;
38 }

References MathLib::TemplatePoint< T, DIM >::getCoords(), and MeshLib::Element::getNode().

Referenced by getSurfaceNormal().

◆ getSurfaceNormal()

◆ testElementNodeOrder()

bool MeshLib::FaceRule::testElementNodeOrder ( Element const &  e)
static

Checks if the node order of an element is correct by testing surface normals. For 2D elements true is returned if the normal points (roughly) upwards.

Definition at line 19 of file FaceRule.cpp.

20 {
21  return getSurfaceNormal(e)[2] < 0;
22 }
static Eigen::Vector3d getSurfaceNormal(Element const &e)
Returns the surface normal of a 2D element.
Definition: FaceRule.cpp:40

References getSurfaceNormal().

Member Data Documentation

◆ dimension

const unsigned MeshLib::FaceRule::dimension = 2u
static

Constant: Dimension of this mesh element.

Definition at line 22 of file FaceRule.h.

◆ n_faces

const unsigned MeshLib::FaceRule::n_faces = 0
static

Constant: The number of faces.

Definition at line 28 of file FaceRule.h.


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