Geophysical Inversion and Modelling Library v1.5.4
Loading...
Searching...
No Matches
GIMLI::TriangleShape Class Reference

#include <shape.h>

+ Inheritance diagram for GIMLI::TriangleShape:
+ Collaboration diagram for GIMLI::TriangleShape:

Public Member Functions

 TriangleShape (MeshEntity *ent)
 
virtual int rtti () const
 
virtual int dim () const
 
virtual std::string name () const
 
virtual RVector3 rst (Index i) const
 
virtual void xyz2rst (const RVector3 &pos, RVector3 &rst) const
 
double area () const
 
virtual RVector3 norm () const
 
virtual bool intersectRay (const RVector3 &start, const RVector3 &dir, RVector3 &pos)
 
- Public Member Functions inherited from GIMLI::Shape
 Shape (MeshEntity *ent)
 
virtual ~Shape ()
 
Index nodeCount () const
 
Nodenode (Index i) const
 
void setNodesPtr (const std::vector< Node * > &n)
 
const std::vector< Node * > & nodes () const
 
virtual std::vector< PolynomialFunction< double > > createShapeFunctions () const
 
void createJacobian (RMatrix3 &J) const
 
RMatrix3 createJacobian () const
 
const RMatrix3invJacobian () const
 
virtual RVector N (const RVector3 &L) const
 
virtual void N (const RVector3 &L, RVector &ret) const
 
virtual void dNdrst (const RVector3 &rst, RMatrix &MdNdrst) const
 
virtual RMatrix dNdrst (const RVector3 &L) const
 
virtual void rst2xyz (const RVector3 &rst, RVector3 &xyz) const
 
virtual RVector3 xyz (const RVector3 &rst) const
 
virtual RVector3 rst (const RVector3 &xyz) const
 
double drstdxyz (uint rstI, uint xyzJ) const
 
virtual bool isInside (const RVector3 &xyz, bool verbose=false) const
 
virtual bool isInside (const RVector3 &xyz, RVector &sf, bool verbose=false) const
 
virtual bool touch (const RVector3 &pos, double tol=1e-6, bool verbose=false) const
 
double domainSize () const
 
RVector3 center () const
 
double h () const
 
virtual Plane plane () const
 
void changed ()
 
double jacobianDeterminant () const
 
void resizeNodeSize_ (Index n)
 

Protected Member Functions

virtual double domainSize_ () const
 

Additional Inherited Members

- Protected Attributes inherited from GIMLI::Shape
Index nodeCount_
 
double domSize_
 
bool hasDomSize_
 
double _h
 
RMatrix3 invJacobian_
 
const std::vector< Node * > * nodeVector_
 

Detailed Description

Triangle shape.

Cartesian $ (x,y) $ to natural coordinates $ (r,s,t) $ relation:

\begin{eqnarray*}        x-x_1 &=& x_{21}s + x_{31} t\\
        y-y_1 &=& y_{21}s + y_{31} t\\
        r   &=& 1-s-t
\end{eqnarray*}

whereas $ x_{ij} $ reads $ x_i - x_j $ for the $x$-coordinate of Node $i$ and $j$ respectively.

Member Function Documentation

◆ dim()

virtual int GIMLI::TriangleShape::dim ( ) const
inlinevirtual

Implements GIMLI::Shape.

◆ domainSize_()

virtual double GIMLI::TriangleShape::domainSize_ ( ) const
inlineprotectedvirtual

Interface to get the size i.e. area of this TriangleShape

Reimplemented from GIMLI::Shape.

◆ intersectRay()

bool GIMLI::TriangleShape::intersectRay ( const RVector3 & start,
const RVector3 & dir,
RVector3 & pos )
virtual
  • Return true if the ray intersects the shape. On boundary means inside too. The intersection position is stored in pos.

Reimplemented from GIMLI::Shape.

References GIMLI::Shape::isInside(), GIMLI::Shape::node(), and GIMLI::Shape::plane().

◆ name()

virtual std::string GIMLI::TriangleShape::name ( ) const
inlinevirtual

Return an identification name for the shape.

Reimplemented from GIMLI::Shape.

◆ norm()

RVector3 GIMLI::TriangleShape::norm ( ) const
virtual

Returns the norm vector if possible otherwise returns non valid Vector3

Reimplemented from GIMLI::Shape.

References GIMLI::Shape::node().

◆ rst()

RVector3 GIMLI::TriangleShape::rst ( Index i) const
virtual

See Shape::rst

Reimplemented from GIMLI::Shape.

References GIMLI::Shape::nodeCount().

Referenced by xyz2rst().

◆ rtti()

virtual int GIMLI::TriangleShape::rtti ( ) const
inlinevirtual

Pure virtual methode for runtime identification.

Implements GIMLI::Shape.

◆ xyz2rst()

void GIMLI::TriangleShape::xyz2rst ( const RVector3 & pos,
RVector3 & rst ) const
virtual

See Shape::xyz2rst. this is a specialized override for speedup.

Reimplemented from GIMLI::Shape.

References GIMLI::Shape::node(), and rst().