Geophysical Inversion and Modelling Library
v1.5.2-5-g042d7f36
|
A Shape defines a geometrical primitive. More...
Inherited by GIMLI::EdgeShape, GIMLI::HexahedronShape, GIMLI::NodeShape, GIMLI::PolygonShape, GIMLI::PyramidShape, GIMLI::QuadrangleShape, GIMLI::TetrahedronShape, GIMLI::TriPrismShape, and GIMLI::TriangleShape.
Public Member Functions | |
Shape (MeshEntity *ent) | |
virtual | ~Shape () |
virtual int | rtti () const =0 |
virtual int | dim () const =0 |
virtual std::string | name () const |
Index | nodeCount () const |
Node & | node (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 RMatrix3 & | invJacobian () 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 void | xyz2rst (const RVector3 &xyz, RVector3 &rst) const |
virtual RVector3 | rst (const RVector3 &xyz) const |
virtual RVector3 | rst (Index i) 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 |
virtual bool | intersectRay (const RVector3 &start, const RVector3 &dir, RVector3 &pos) |
double | domainSize () const |
RVector3 | center () const |
virtual RVector3 | norm () const |
double | h () const |
virtual Plane | plane () const |
void | changed () |
double | jacobianDeterminant () const |
void | resizeNodeSize_ (Index n) |
Protected Member Functions | |
virtual double | domainSize_ () const |
Protected Attributes | |
Index | nodeCount_ |
double | domSize_ |
bool | hasDomSize_ |
double | _h |
RMatrix3 | invJacobian_ |
const std::vector< Node * > * | nodeVector_ |
A Shape defines a geometrical primitive.
A Shape defines a geometrical primitive. And is the geometrical base of a MeshEntity.
GIMLI::Shape::Shape | ( | MeshEntity * | ent | ) |
Default constructor.
References setNodesPtr().
|
virtual |
Default destructor.
RVector3 GIMLI::Shape::center | ( | ) | const |
Returns the middle position of this shape
References node(), and nodeCount().
Referenced by GIMLI::MeshEntity::center().
void GIMLI::Shape::changed | ( | ) |
Notify this shape that the inverse Jacobian matrix and the domain size are not longer valid and need recalculation. This method is called if a node has bee transformed.
Referenced by GIMLI::MeshEntity::changed().
void GIMLI::Shape::createJacobian | ( | RMatrix3 & | J | ) | const |
Create and return the Jacobian matrix for this shape at the local coordinate .
The Jacobian matrix is a 3x3 matrix representing the absolute derivative matrix for this shape regarding the shape functions:
for i = [1,2,3]
the inverse of the Jacobian results in:
References dNdrst(), GIMLI::Singleton< ShapeFunctionCache >::instance(), node(), nodeCount(), rtti(), GIMLI::x(), GIMLI::y(), and GIMLI::z().
Referenced by invJacobian().
|
virtual |
Return the derivative matrix of size ( ) for the shape functions at the local coordinate. . Result is independent of L for linear shape function (TODO Remove on cleanup) for
References GIMLI::Singleton< ShapeFunctionCache >::instance(), and rst().
Referenced by createJacobian().
double GIMLI::Shape::domainSize | ( | ) | const |
Get the domain size of this shape, i.e., length, area or volume
References domainSize_().
Referenced by GIMLI::MeshEntity::size().
|
inlineprotectedvirtual |
Virtual method to calculate the domain size i.e length, area, volume of the shapes
Reimplemented in GIMLI::TriPrismShape, GIMLI::TriangleShape, GIMLI::EdgeShape, and GIMLI::NodeShape.
Referenced by domainSize().
|
inline |
Return derivative from local coordinates to Cartesian coordinates. These are the elements of the inverse Jacobian matrix.
double GIMLI::Shape::h | ( | ) | const |
Returns maximum distance between 2 nodes.
References node(), and nodeCount().
|
inlinevirtual |
Reimplemented in GIMLI::TriangleShape, and GIMLI::EdgeShape.
Referenced by GIMLI::Mesh::findCellsAlongRay().
const RMatrix3 & GIMLI::Shape::invJacobian | ( | ) | const |
Return the inverse of the Jacobian Matrix. And create and cache it on demand. The matrix is no more valid if the shape was transformed.
References createJacobian(), GIMLI::Singleton< ShapeFunctionCache >::instance(), and GIMLI::inv().
Referenced by GIMLI::MeshEntity::grad(), and xyz2rst().
|
virtual |
Return true if the Cartesian coordinates xyz are inside the shape. On boundary means inside too. Works only for shapes dedicated as cells because they need to be aligned to the dimension. See also touch.
Reimplemented in GIMLI::PolygonShape.
References xyz().
Referenced by GIMLI::TriangleShape::intersectRay().
|
virtual |
Return true if the Cartesian coordinates xyz are inside the shape. On boundary means inside too. sf contains the complete shape function to identify next neighbor. Works only for shapes dedicated as cells because they need to be aligned to the dimension. See also touch.
References GIMLI::Pos::abs(), N(), rst(), and xyz().
Return a RVector for the shape functions at the local coordinate .
References nodeCount(), and rst().
Referenced by isInside(), N(), and rst2xyz().
TODO replace this with expressions.
Fill the allocated RVector n of size for the \mathcal{N} shape functions for the local coordinate . For performance reasons the size of L will not be checked. This method needs to be specialized in the corresponding child classes.
References GIMLI::Singleton< ShapeFunctionCache >::instance(), N(), and rst().
|
inlinevirtual |
Return an identification name for the shape.
Reimplemented in GIMLI::TriPrismShape, GIMLI::HexahedronShape, GIMLI::TetrahedronShape, GIMLI::PolygonShape, GIMLI::QuadrangleShape, GIMLI::TriangleShape, GIMLI::EdgeShape, and GIMLI::NodeShape.
Node & GIMLI::Shape::node | ( | Index | i | ) | const |
Return a read only reference to the i-th Node of this shape.
References nodeCount().
Referenced by center(), createJacobian(), h(), GIMLI::EdgeShape::intersectRay(), GIMLI::TriangleShape::intersectRay(), GIMLI::EdgeShape::norm(), GIMLI::TriangleShape::norm(), plane(), rst2xyz(), touch(), GIMLI::EdgeShape::touch(), GIMLI::TriangleShape::xyz2rst(), and GIMLI::TetrahedronShape::xyz2rst().
|
inline |
Return the amount of nodes for this shape.
Referenced by center(), createJacobian(), GIMLI::Mesh::createNeighborInfosCell_(), h(), N(), node(), plane(), GIMLI::EdgeShape::rst(), GIMLI::TriangleShape::rst(), GIMLI::QuadrangleShape::rst(), GIMLI::TetrahedronShape::rst(), GIMLI::HexahedronShape::rst(), GIMLI::TriPrismShape::rst(), GIMLI::PyramidShape::rst(), GIMLI::Boundary::rst(), rst2xyz(), and touch().
|
inline |
Return a read only reference to all nodes.
|
virtual |
Returns the norm vector if possible otherwise returns non valid Vector3
Reimplemented in GIMLI::PolygonShape, GIMLI::TriangleShape, GIMLI::EdgeShape, and GIMLI::NodeShape.
Referenced by GIMLI::Boundary::norm(), and plane().
|
virtual |
Returns the a plane for this shape if its possible (2D or 3D plane shapes) otherwise returns non valid Plane.
References GIMLI::Pos::abs(), node(), nodeCount(), and norm().
Referenced by GIMLI::Mesh::copyBoundary(), GIMLI::TriangleShape::intersectRay(), GIMLI::PolygonShape::norm(), and touch().
Return local coordinates for Cartesian coordinates regarding the shape function.
References xyz(), and xyz2rst().
Referenced by GIMLI::ElectrodeShapeEntity::assembleRHS(), dNdrst(), GIMLI::MeshEntity::grad(), GIMLI::Mesh::interpolationMatrix(), isInside(), N(), GIMLI::MeshEntity::rst(), GIMLI::Boundary::rst(), GIMLI::Edge3::rst(), GIMLI::Triangle6Face::rst(), GIMLI::Quadrangle8Face::rst(), xyz(), and xyz2rst().
|
virtual |
Return local coordinates for node i.
Reimplemented in GIMLI::PyramidShape, GIMLI::TriPrismShape, GIMLI::HexahedronShape, GIMLI::TetrahedronShape, GIMLI::PolygonShape, GIMLI::QuadrangleShape, GIMLI::TriangleShape, GIMLI::EdgeShape, and GIMLI::NodeShape.
References rtti().
Perform coordinate transformation from the locale coordinates of this shape to Cartesian coordinates regarding to the shape functions N with
This is the opposite to xyz2rst().
This is a generic function and may be overwritten by faster methods for shape simplexes.
References N(), node(), nodeCount(), and xyz().
Referenced by xyz().
|
pure virtual |
Pure virtual methode for runtime identification.
Implemented in GIMLI::PyramidShape, GIMLI::TriPrismShape, GIMLI::HexahedronShape, GIMLI::TetrahedronShape, GIMLI::PolygonShape, GIMLI::QuadrangleShape, GIMLI::TriangleShape, GIMLI::EdgeShape, and GIMLI::NodeShape.
Referenced by GIMLI::IntegrationRules::abscissa(), createJacobian(), createShapeFunctions(), rst(), and GIMLI::IntegrationRules::weights().
|
inline |
|
virtual |
Check if the position touches the entity. Works only for shapes dedicated as boundaries. On edge of the boundary means inside too. See also isInside.
Reimplemented in GIMLI::EdgeShape.
References GIMLI::Pos::dist(), GIMLI::Line::intersectRay(), node(), nodeCount(), plane(), GIMLI::Line::t(), and GIMLI::Plane::touch().
Referenced by GIMLI::Mesh::copyBoundary().
Return the Cartesian coordinates for the locale coordinates rst. See rst2xyz.
References rst(), and rst2xyz().
Referenced by GIMLI::calcGCells(), GIMLI::Mesh::createRefined_(), GIMLI::evaluateQuadraturePoints(), isInside(), rst(), rst2xyz(), and xyz2rst().
Convert Cartesian coordinates into locale coordinates regarding the shape functions. This is the opposite to xyz2rst. This is a generic function and may be overwritten by faster methods for shape simplexes. Solve the nonlinear system of equations by newton method
Reimplemented in GIMLI::TetrahedronShape, and GIMLI::TriangleShape.
References GIMLI::Pos::abs(), invJacobian(), rst(), and xyz().
Referenced by rst().