Geophysical Inversion and Modelling Library v1.5.4
|
A Shape defines a geometrical primitive. More...
#include <shape.h>
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 center(), node(), and nodeCount().
Referenced by 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.
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
for i = [1,2,3]
the inverse of the Jacobian results in:
References createJacobian(), dNdrst(), GIMLI::Singleton< ShapeFunctionCache >::instance(), node(), nodeCount(), rtti(), GIMLI::x(), GIMLI::y(), and GIMLI::z().
Referenced by createJacobian(), and invJacobian().
|
virtual |
Return the derivative matrix of size (
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_().
|
inlineprotectedvirtual |
Virtual method to calculate the domain size i.e length, area, volume of the shapes
Reimplemented in GIMLI::EdgeShape, GIMLI::HexahedronShape, GIMLI::NodeShape, GIMLI::QuadrangleShape, GIMLI::TetrahedronShape, GIMLI::TriangleShape, and GIMLI::TriPrismShape.
Referenced by domainSize().
|
inline |
Return derivative from local coordinates to Cartesian coordinates. These are the elements of the inverse Jacobian matrix.
References invJacobian().
double GIMLI::Shape::h | ( | ) | const |
Returns maximum distance between 2 nodes.
References node(), and nodeCount().
|
inlinevirtual |
Reimplemented in GIMLI::EdgeShape, GIMLI::QuadrangleShape, and GIMLI::TriangleShape.
References name(), and rtti().
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 drstdxyz(), 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 isInside(), and xyz().
Referenced by GIMLI::QuadrangleShape::intersectRay(), GIMLI::TriangleShape::intersectRay(), and isInside().
|
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.
Return a RVector for the
References N(), nodeCount(), and rst().
Referenced by isInside(), N(), N(), and rst2xyz().
TODO replace this with expressions.
Fill the allocated RVector n of size
References GIMLI::Singleton< ShapeFunctionCache >::instance(), N(), and rst().
|
inlinevirtual |
Return an identification name for the shape.
Reimplemented in GIMLI::EdgeShape, GIMLI::HexahedronShape, GIMLI::NodeShape, GIMLI::PolygonShape, GIMLI::QuadrangleShape, GIMLI::TetrahedronShape, GIMLI::TriangleShape, and GIMLI::TriPrismShape.
Referenced by intersectRay().
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::QuadrangleShape::intersectRay(), GIMLI::TriangleShape::intersectRay(), GIMLI::EdgeShape::norm(), GIMLI::QuadrangleShape::norm(), GIMLI::TriangleShape::norm(), plane(), rst2xyz(), GIMLI::EdgeShape::touch(), touch(), GIMLI::TetrahedronShape::volume(), GIMLI::TetrahedronShape::xyz2rst(), and GIMLI::TriangleShape::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::HexahedronShape::rst(), GIMLI::PyramidShape::rst(), GIMLI::QuadrangleShape::rst(), GIMLI::TetrahedronShape::rst(), GIMLI::TriangleShape::rst(), GIMLI::TriPrismShape::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::EdgeShape, GIMLI::NodeShape, GIMLI::PolygonShape, GIMLI::QuadrangleShape, and GIMLI::TriangleShape.
Referenced by 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(), norm(), and plane().
Referenced by GIMLI::Mesh::copyBoundary(), GIMLI::QuadrangleShape::intersectRay(), GIMLI::TriangleShape::intersectRay(), GIMLI::PolygonShape::norm(), plane(), and touch().
|
virtual |
Return local coordinates for node i.
Reimplemented in GIMLI::EdgeShape, GIMLI::HexahedronShape, GIMLI::NodeShape, GIMLI::PolygonShape, GIMLI::PyramidShape, GIMLI::QuadrangleShape, GIMLI::TetrahedronShape, GIMLI::TriangleShape, and GIMLI::TriPrismShape.
References rtti().
Perform coordinate transformation from the locale coordinates
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(), rst(), and xyz().
Referenced by xyz().
|
pure virtual |
Pure virtual methode for runtime identification.
Implemented in GIMLI::EdgeShape, GIMLI::HexahedronShape, GIMLI::NodeShape, GIMLI::PolygonShape, GIMLI::PyramidShape, GIMLI::QuadrangleShape, GIMLI::TetrahedronShape, GIMLI::TriangleShape, and GIMLI::TriPrismShape.
Referenced by GIMLI::IntegrationRules::abscissa(), createJacobian(), createShapeFunctions(), intersectRay(), rst(), and GIMLI::IntegrationRules::weights().
|
inline |
Return a reference to the i-th Node of this shape.
Set the ptr to nodes array from, which the MeshEntity holds.
Referenced by Shape().
|
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(), GIMLI::Plane::touch(), and touch().
Referenced by GIMLI::Mesh::copyBoundary(), and touch().
Return the Cartesian coordinates for the locale coordinates rst. See rst2xyz.
References rst(), rst2xyz(), and xyz().
Referenced by GIMLI::calcGCells(), GIMLI::Mesh::createRefined_(), GIMLI::evaluateQuadraturePoints(), GIMLI::evaluateQuadraturePoints(), GIMLI::evaluateQuadraturePoints(), GIMLI::PolygonShape::isInside(), isInside(), isInside(), rst(), rst2xyz(), xyz(), 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().