Geophysical Inversion and Modelling Library  v1.5.2-5-g042d7f36
GIMLI::MeshEntity Class Reference
+ Inheritance diagram for GIMLI::MeshEntity:
+ Collaboration diagram for GIMLI::MeshEntity:

Public Member Functions

 MeshEntity ()
 
virtual ~MeshEntity ()
 
virtual uint dim () const
 
virtual uint rtti () const
 
virtual uint parentType () const
 
virtual void setNodes (const std::vector< Node * > &nodes)
 
const std::vector< Node * > & nodes () const
 
Nodenode (uint i)
 
Nodenode (uint i) const
 
uint nodeCount () const
 
Shapeshape ()
 
Shapeshape () const
 
ShapepShape ()
 
RVector3 rst (uint i) const
 
RVector3 center () const
 
double size () const
 
virtual double attribute () const
 
IndexArray ids () const
 
virtual std::vector< PolynomialFunction< double > > createShapeFunctions () const
 
virtual RVector N (const RVector3 &rst) const
 
virtual void N (const RVector3 &rst, RVector &n) const
 
virtual RVector dNdL (const RVector3 &rst, uint i) const
 
virtual RMatrix dNdL (const RVector3 &rst) const
 
double pot (const RVector3 &p, const RVector &u) const
 
RVector3 vec (const RVector3 &p, const R3Vector &v) const
 
RVector3 grad (const RVector3 &p, const RVector &u) const
 
void setUxCache (const RMatrix &mat) const
 
const RMatrixuxCache () const
 
ElementMatrix< double > & uCache ()
 
ElementMatrix< double > & gradUCache ()
 
void changed ()
 
void addSecondaryNode (Node *n)
 
void delSecondaryNode (Node *n)
 
const std::vector< Node * > & secondaryNodes () const
 
const std::vector< Node * > allNodes () const
 
Index allNodeCount () const
 
virtual bool enforcePositiveDirection ()
 
- Public Member Functions inherited from GIMLI::BaseEntity
 BaseEntity (const BaseEntity &ent)
 
BaseEntityoperator= (const BaseEntity &ent)
 
virtual bool valid () const
 
virtual void setValid (bool valid)
 
int id () const
 
void setId (int id)
 
void setMarker (int marker)
 
int marker () const
 
void setTagged (bool tagged)
 
void untag ()
 
void tag ()
 
bool tagged () const
 

Protected Member Functions

void fillShape_ ()
 
virtual void registerNodes_ ()
 
virtual void deRegisterNodes_ ()
 
virtual void registerSecNode_ (Node *n)
 
virtual void deRegisterSecNode_ (Node *n)
 
 MeshEntity (const MeshEntity &ent)
 
MeshEntityoperator= (const MeshEntity &ent)
 

Protected Attributes

Shapeshape_
 
std::vector< Node * > nodeVector_
 
std::vector< Node * > secondaryNodes_
 
ElementMatrix< double > uCache_
 
ElementMatrix< double > gradUCache_
 
RMatrix uxCache_
 
- Protected Attributes inherited from GIMLI::BaseEntity
int id_
 
bool valid_
 
int marker_
 
bool tagged_
 

Friends

std::ostream & operator<< (std::ostream &str, const MeshEntity &c)
 

Constructor & Destructor Documentation

◆ MeshEntity() [1/2]

GIMLI::MeshEntity::MeshEntity ( )

Default constructor.

◆ ~MeshEntity()

GIMLI::MeshEntity::~MeshEntity ( )
virtual

Default destructor.

◆ MeshEntity() [2/2]

GIMLI::MeshEntity::MeshEntity ( const MeshEntity ent)
inlineprotected

do not copy a mesh entity at all

Member Function Documentation

◆ allNodes()

const std::vector< Node * > GIMLI::MeshEntity::allNodes ( ) const

Return primary and secondary nodes

◆ center()

◆ changed()

void GIMLI::MeshEntity::changed ( )

Geometry has been changed. Deletes cache.

References GIMLI::Shape::changed(), and uCache_.

Referenced by GIMLI::Boundary::swapNorm().

◆ dim()

◆ dNdL() [1/2]

RMatrix GIMLI::MeshEntity::dNdL ( const RVector3 rst) const
virtual

Return the complete (n,3) matrix for all $ n=[0,\mathrm{nodeCount()}] $ shape functions of all nodes of the current MeshEntity $ \frac{\partial N_n(L_1,L_2,L_3)}{\partial L_i} $ with $ i = 0,1,2 $

References dNdL(), and GIMLI::Matrix< ValueType >::push_back().

◆ dNdL() [2/2]

RVector GIMLI::MeshEntity::dNdL ( const RVector3 rst,
uint  i 
) const
virtual

Return a RVector of the derivation for the $ n=[0,\mathrm{nodeCount()}] $ shape functions $ N_n(L_1,L_2,L_3)$ for the local coordinate $ (L_1,L_2,L_3)$ regarding to the local coordinates $ L_i $
$ \frac{\partial N_n(L_1,L_2,L_3)}{\partial L_i} $ with may be $ i = 0,1,2 $

References GIMLI::Singleton< ShapeFunctionCache >::instance(), and rst().

Referenced by dNdL(), and grad().

◆ enforcePositiveDirection()

bool GIMLI::MeshEntity::enforcePositiveDirection ( )
virtual

Reverse node sequence order to enforce positive Jacobian determinant. Please use with care! Return True if the order has been changed.

◆ grad()

RVector3 GIMLI::MeshEntity::grad ( const RVector3 p,
const RVector u 
) const

Return gradient at position pos for field u regarding to the shape functions of the entity. The field vector u need to be of size mesh.nodeCount() for the corresponding mesh. The position pos, in Cartesian coordinates (x,y,z), need to be inside, or on the boundary, of the entity.

References dNdL(), ids(), GIMLI::Shape::invJacobian(), GIMLI::Matrix< ValueType >::push_back(), GIMLI::Shape::rst(), rst(), and GIMLI::Matrix< ValueType >::transMult().

◆ ids()

IndexArray GIMLI::MeshEntity::ids ( ) const

◆ N() [1/2]

RVector GIMLI::MeshEntity::N ( const RVector3 rst) const
virtual

Return a RVector(n) for $ N(L) = {N_i} i = [0, \mathrm{nodeCount()}] $ shape functions $ N_n(L_1,L_2,L_3)$ in local coordinates $ L(L1, L2, L3) = L(r, s, t)$

Referenced by GIMLI::ElectrodeShapeEntity::assembleRHS(), GIMLI::Mesh::interpolationMatrix(), N(), and pot().

◆ N() [2/2]

void GIMLI::MeshEntity::N ( const RVector3 rst,
RVector n 
) const
virtual

Inplace variant of N

References GIMLI::Singleton< ShapeFunctionCache >::instance(), N(), and rst().

◆ operator=()

MeshEntity& GIMLI::MeshEntity::operator= ( const MeshEntity ent)
inlineprotected

do not assign a mesh entity at all

◆ parentType()

virtual uint GIMLI::MeshEntity::parentType ( ) const
inlinevirtual

To separate between major MeshEntity families e.g. Cell and Boundary.

Reimplemented in GIMLI::Boundary, and GIMLI::Cell.

Referenced by GIMLI::ElectrodeShapeEntity::geomMeanCellAttributes().

◆ pot()

double GIMLI::MeshEntity::pot ( const RVector3 p,
const RVector u 
) const

Interpolate a scalar field at position p for the scalar field u regarding to the shape functions of the entity.

Parameters
pCartesian coordinates (x,y,z) need to be inside, or on the boundary, of the entity.
uThe field vector u need to be of size mesh.nodeCount() for the corresponding mesh.

References ids(), N(), and rst().

Referenced by GIMLI::ElectrodeShapeEntity::pot(), and vec().

◆ rst()

RVector3 GIMLI::MeshEntity::rst ( uint  i) const

Return rst-coordinates for the i-th node. See Shape::rst.

References GIMLI::Pos::round(), and GIMLI::Shape::rst().

Referenced by dNdL(), grad(), N(), and pot().

◆ rtti()

◆ size()

double GIMLI::MeshEntity::size ( ) const

Return the size (i.e., length, area, volume) of this MeshEntity.

References GIMLI::Shape::domainSize().

Referenced by GIMLI::Mesh::boundarySizes(), GIMLI::Mesh::cellSizes(), and GIMLI::prepExportSensitivityData().

◆ vec()

RVector3 GIMLI::MeshEntity::vec ( const RVector3 p,
const R3Vector v 
) const

Interpolate a vector field at position p for the vector field v regarding to the shape functions of the entity.

Parameters
pCartesian coordinates (x,y,z) need to be inside, or on the boundary, of the entity.
vThe vector field vector v need to be of size mesh.nodeCount() for the corresponding mesh.

References pot(), GIMLI::x(), GIMLI::y(), and GIMLI::z().

Member Data Documentation

◆ uCache_

ElementMatrix< double > GIMLI::MeshEntity::uCache_
mutableprotected

Cache for derivation matrixes

Referenced by changed().