Geophysical Inversion and Modeling Library  v1.0.11-38-g7483f4dd
GIMLI::MeshEntity Class Reference
+ Inheritance diagram for GIMLI::MeshEntity:
+ Collaboration diagram for GIMLI::MeshEntity:

Public Member Functions

 MeshEntity ()
 
 MeshEntity (const std::vector< Node * > &nodes)
 
virtual ~MeshEntity ()
 
virtual uint dim () const
 
virtual uint rtti () const
 
virtual uint parentType () 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 std::vector< RVector3 > &v) const
 
RVector3 grad (const RVector3 &p, const RVector &u) const
 
const std::vector< Node *> & nodes () const
 
void setUxCache (const RMatrix &mat) const
 
const RMatrixuxCache () const
 
void addSecondaryNode (Node *n)
 
const std::vector< Node *> & secondaryNodes () const
 
const std::vector< Node *> allNodes () const
 
Index allNodeCount () const
 
- 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_ ()
 
void setNodes_ (const std::vector< Node * > &nodes)
 
void deRegisterNodes_ ()
 
 MeshEntity (const MeshEntity &ent)
 
MeshEntityoperator= (const MeshEntity &ent)
 

Protected Attributes

Shapeshape_
 
std::vector< Node *> nodeVector_
 
std::vector< Node *> secondaryNodes_
 
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/3]

GIMLI::MeshEntity::MeshEntity ( )

Default constructor.

◆ MeshEntity() [2/3]

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

Construct the entity from the given nodes.

◆ ~MeshEntity()

GIMLI::MeshEntity::~MeshEntity ( )
virtual

Default destructor.

◆ MeshEntity() [3/3]

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()

◆ dim()

◆ dNdL() [1/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().

◆ dNdL() [2/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().

◆ 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(), rst(), and GIMLI::Shape::rst().

◆ ids()

IndexArray GIMLI::MeshEntity::ids ( ) const

Return IndexArray of all node ids.

References GIMLI::BaseEntity::id().

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

◆ 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.

References GIMLI::str().

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::Shape::rst(), and rtti().

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

◆ rtti()

◆ size()

◆ vec()

RVector3 GIMLI::MeshEntity::vec ( const RVector3 p,
const std::vector< RVector3 > &  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

◆ uxCache_

RMatrix GIMLI::MeshEntity::uxCache_
mutableprotected

Cache for derivation matrixes