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 Eigen::Vector3d const v =
27 e.getNode(0)->asEigenVector3d() - e.getNode(1)->asEigenVector3d();
28 return v;
29}
static const double v

References MathLib::Point3d::asEigenVector3d(), MeshLib::Element::getNode(), and MathLib::v.

Referenced by getSurfaceNormal().

◆ getSecondSurfaceVector()

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

Definition at line 31 of file FaceRule.cpp.

32{
33 Eigen::Vector3d const v =
34 e.getNode(2)->asEigenVector3d() - e.getNode(1)->asEigenVector3d();
35 return v;
36}

References MathLib::Point3d::asEigenVector3d(), MeshLib::Element::getNode(), and MathLib::v.

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:38

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: