24#ifndef _GEMA_TRI_CELL_GEOMETRY_INFO_H_
25#define _GEMA_TRI_CELL_GEOMETRY_INFO_H_
84 GmTriEdgeIntegrationRuleSet, GmLinearTriEdgeIntegrationRuleSetDefaults>
111 int ret = GM_GEOMETRY_STATE_VALID;
144 int ret = GM_GEOMETRY_STATE_VALID;
145 if (GmGeometryUtils::tri3DIsColinear(X)) ret |= GM_GEOMETRY_STATE_SELF_INTERSECT;
166static int tri6order[] = {0,3,1,4,2,5};
171 GmTriEdgeIntegrationRuleSet, GmQuadraticTriEdgeIntegrationRuleSetDefaults>
193 int ret = GM_GEOMETRY_STATE_VALID;
229 int ret = GM_GEOMETRY_STATE_VALID;
231 if (GmGeometryUtils::tri3DIsColinear(X.cols(0, 2))) ret |= GM_GEOMETRY_STATE_SELF_INTERSECT;
void centroidByIntegration(const GmMatrix &X, GmVector &coord, const GmIntegrationRule *ir=NULL) const
Given a cell geometry defined by matrix X (with node coordinates organized by column) performs a nume...
Definition gmCellGeometryInfo.cpp:114
double dimensionByIntegration(const GmMatrix &X, const GmIntegrationRule *ir=NULL) const
Given a cell geometry defined by matrix X (with node coordinates organized by column) performs a nume...
Definition gmCellGeometryInfo.cpp:76
An auxiliary class that can be used as base for surface elements. Implements the needed integration r...
Definition gmCellGeometryInfo.h:408
A helper class used to store the default rules for each rule type. Template parameters are the defaul...
Definition gmCellGeometryIntegrationRuleSet.h:44
A helper class used to store the class types for each rule type. Template parameters are the implemen...
Definition gmCellGeometryIntegrationRuleSet.h:197
A type used to represent a 'unexistant" integration rule. Should be used as template parameter for Gm...
Definition gmCellGeometryIntegrationRuleSet.h:35
Shape function handling base classe.
Definition gmShape.h:38
The Tri3 implementation.
Definition gmTriCellGeometryInfo.h:85
virtual void centroidCartesian(const GmMatrix &X, GmVector &coord) const
Returns the Tri3 centroid by calculating the mean of the vertices (simplex centroid)
Definition gmTriCellGeometryInfo.h:99
virtual double dimension(const GmMatrix &X) const
Returns the Tri3 area.
Definition gmTriCellGeometryInfo.h:93
virtual bool localAxis(const GmMatrix &X, GmMatrix &R) const
Local axis for Tri == Identity.
Definition gmTriCellGeometryInfo.h:105
GmTri3CellGeometryInfo(GmCellGeometryMetadata &&metadata)
Protected constructor. Only a single Tri3 geometry info object is ever necessary, created by GmTriCel...
Definition gmTriCellGeometryInfo.h:122
virtual GmShape * shapeInstance(int P, int Q) const
Shape function factory. Should return a NEW instance of the shape function object for this type....
Definition gmTriCellGeometryInfo.h:90
virtual bool contains(const GmMatrix &X, const GmVector &coord) const
Virtual method that should be implemented if this geometry info supports the GM_CELL_GEOMETRY_CONTAIN...
Definition gmTriCellGeometryInfo.h:118
virtual int isValid(const GmMatrix &X, double tol) const
Virtual method that should be implemented if this geometry info supports the GM_CELL_GEOMETRY_VALID c...
Definition gmTriCellGeometryInfo.h:109
The Tri3D3 implementation.
Definition gmTriCellGeometryInfo.h:133
virtual int isValid(const GmMatrix &X, double tol) const
Virtual method that should be implemented if this geometry info supports the GM_CELL_GEOMETRY_VALID c...
Definition gmTriCellGeometryInfo.h:142
GmTri3D3CellGeometryInfo(const GmTri3CellGeometryInfo &tri3)
Private constructor. Only a single Tri3D3 geometry info object is ever necessary, created by GmTriCel...
Definition gmTriCellGeometryInfo.h:158
virtual bool contains(const GmMatrix &X, const GmVector &coord) const
Virtual method that should be implemented if this geometry info supports the GM_CELL_GEOMETRY_CONTAIN...
Definition gmTriCellGeometryInfo.h:150
virtual bool localAxis(const GmMatrix &X, GmMatrix &R) const
Local axis for Tri == Identity.
Definition gmTriCellGeometryInfo.h:154
virtual GmShape * shapeInstance(int P, int Q) const
Shape function factory. Should return a NEW instance of the shape function object for this type....
Definition gmTriCellGeometryInfo.h:138
GmShape specialization for a 3D Triangle with 3 nodes object.
Definition gmTriShape.h:175
The Tri3D6 implementation.
Definition gmTriCellGeometryInfo.h:215
virtual bool contains(const GmMatrix &X, const GmVector &coord) const
Virtual method that should be implemented if this geometry info supports the GM_CELL_GEOMETRY_CONTAIN...
Definition gmTriCellGeometryInfo.h:237
virtual bool localAxis(const GmMatrix &X, GmMatrix &R) const
Local axis for Tri == Identity.
Definition gmTriCellGeometryInfo.h:224
GmTri3D6CellGeometryInfo(const GmTri6CellGeometryInfo &tri6)
Private constructor. Only a single Tri3D6 geometry info object is ever necessary, created by GmTriCel...
Definition gmTriCellGeometryInfo.h:241
virtual int isValid(const GmMatrix &X, double tol) const
Virtual method that should be implemented if this geometry info supports the GM_CELL_GEOMETRY_VALID c...
Definition gmTriCellGeometryInfo.h:228
virtual GmShape * shapeInstance(int P, int Q) const
Shape function factory. Should return a NEW instance of the shape function object for this type....
Definition gmTriCellGeometryInfo.h:220
GmShape specialization for a 3D Triangle with 6 nodes object.
Definition gmTriShape.h:206
GmShape specialization for a Triangle with 3 nodes object.
Definition gmTriShape.h:115
The Tri6 implementation.
Definition gmTriCellGeometryInfo.h:172
virtual double dimension(const GmMatrix &X) const
Returns the Tri6 area by numeric integration.
Definition gmTriCellGeometryInfo.h:180
virtual int isValid(const GmMatrix &X, double tol) const
Virtual method that should be implemented if this geometry info supports the GM_CELL_GEOMETRY_VALID c...
Definition gmTriCellGeometryInfo.h:190
virtual GmShape * shapeInstance(int P, int Q) const
Shape function factory. Should return a NEW instance of the shape function object for this type....
Definition gmTriCellGeometryInfo.h:177
GmTri6CellGeometryInfo(GmCellGeometryMetadata &&metadata)
Protected constructor. Only a single Tri6 geometry info object is ever necessary, created by GmTriCel...
Definition gmTriCellGeometryInfo.h:204
virtual void centroidCartesian(const GmMatrix &X, GmVector &coord) const
Returns the Tri6 centroid by numeric integration.
Definition gmTriCellGeometryInfo.h:183
virtual bool contains(const GmMatrix &X, const GmVector &coord) const
Virtual method that should be implemented if this geometry info supports the GM_CELL_GEOMETRY_CONTAIN...
Definition gmTriCellGeometryInfo.h:200
virtual bool localAxis(const GmMatrix &X, GmMatrix &R) const
Local axis for Tri == Identity.
Definition gmTriCellGeometryInfo.h:186
GmShape specialization for a Triangle with 6 nodes object.
Definition gmTriShape.h:149
Gauss integration rule for Tri element borders.
Definition gmTriIntegrationRule.h:96
Gauss Integration rule for triangle elements. Base on Felippa, IFEM, section 24.2.
Definition gmTriIntegrationRule.h:43
Newton Integration rule for triangle elements. Accepts both open and closed rules.
Definition gmTriIntegrationRule.h:66
Declaration of the GmCellGeometryInfo base class.
Declaration of the GmCellGeometryIntegrationRuleSet class & friends.
#define GMC_API_EXPORT
Macro for controlling if the class is being exported (GEMA_CORE_LIB defined) or imported (GEMA_CORE_L...
Definition gmCoreConfig.h:35
Utilitary functions for working with geometry.
@ GM_GAUSS_RULE_TYPE
Gauss rules.
Definition gmIntegrationRule.h:75
arma::mat GmMatrix
The basic type for a GeMA matrix object. Currently based on an Armadillo matrix.
Definition gmMatrix.h:38
GmCellGeometryIntegrationRuleSetDefaultRules< GM_GAUSS_RULE_TYPE, 2, -1, -1, -1 > GmLinearTriEdgeIntegrationRuleSetDefaults
The set of default rules for a linear Tri EDGE. Template parameters 2 to 5 are the default rule numbe...
Definition gmTriCellGeometryInfo.h:60
GmCellGeometryIntegrationRuleSetDefaultRules< GM_GAUSS_RULE_TYPE, 3, -1, 1, 1 > GmLinearTriIntegrationRuleSetDefaults
The set of default rules for a linear Tri ELEMENT. Template parameters 2 to 5 are the default rule nu...
Definition gmTriCellGeometryInfo.h:55
GmCellGeometryIntegrationRuleSet< GmTriGaussIntegrationRule, GmCellGeometryNullIntegrationRule, GmTriNewtonIntegrationRule, GmTriNewtonIntegrationRule > GmTriIntegrationRuleSet
The set of possible ELEMENT integration rules, per integration rule type, for the family of Tri eleme...
Definition gmTriCellGeometryInfo.h:41
GmCellGeometryIntegrationRuleSetDefaultRules< GM_GAUSS_RULE_TYPE, 3, -1, -1, -1 > GmQuadraticTriEdgeIntegrationRuleSetDefaults
The set of default rules for a quadratic Tri EDGE. Template parameters 2 to 5 are the default rule nu...
Definition gmTriCellGeometryInfo.h:74
GmCellGeometryIntegrationRuleSet< GmTriGaussEdgeIntegrationRule, GmCellGeometryNullIntegrationRule, GmCellGeometryNullIntegrationRule, GmCellGeometryNullIntegrationRule > GmTriEdgeIntegrationRuleSet
The set of possible EDGE integration rules, per integration rule type, for the family of Tri elements...
Definition gmTriCellGeometryInfo.h:45
GmCellGeometryIntegrationRuleSetDefaultRules< GM_GAUSS_RULE_TYPE, 6, -1, 2, 2 > GmQuadraticTriIntegrationRuleSetDefaults
The set of default rules for a quadratic Tri ELEMENT. Template parameters 2 to 5 are the default rule...
Definition gmTriCellGeometryInfo.h:69
Declaration of the GmTriXxxxIntegrationRule family of classes, including border rules....
Declaration of the 2D tri shapes inheriting from GmShape class Previosuly part of the gmShape2D....
arma::vec GmVector
The basic type for a GeMA vector object. Currently based on an Armadillo vector.
Definition gmVector.h:34
void triangleCentroid(const GmVector &p1, const GmVector &p2, const GmVector &p3, GmVector &coord)
Returns the cartesian coordinate of the triangle centroid.
Definition gmGeometryUtils.cpp:262
bool polygon3DIsPlanar(const GmMatrix &X, double tol)
Returns true if the polygon delimited by the cell vertices is planar.
Definition gmGeometryUtils.cpp:556
bool pointInConvexPolygon(const GmMatrix &X, const GmVector &p)
Returns true if the point p is inside the polygon delimited by the cell vertices (convex hull),...
Definition gmGeometryUtils.cpp:614
double triangleArea(const GmVector &p1, const GmVector &p2, const GmVector &p3)
Calculates the area of the triangle determined by points p1, p2 and p3 (2D or 3D),...
Definition gmGeometryUtils.cpp:161
bool pointInTesselatedPolygon_T6(const GmMatrix &X, const GmVector &p)
Returns true if the point p is inside the tesselated T6 polygon or false otherwise.
Definition gmGeometryUtils.cpp:635
bool polygon2DIsSelfIntersecting(const GmMatrix &X)
Returns true if the polygon delimited by the cell vertices is self-intersecting, or false otherwise.
Definition gmGeometryUtils.cpp:467
bool polygon2DIsCCW(const GmMatrix &X)
Returns true if the polygon delimited by the cell vertices is oriented CCW.
Definition gmGeometryUtils.cpp:496
GmMatrix shuffle(const GmMatrix &X, const int order[], int size)
Returns quad8 vertices in circular order.
Definition gmGeometryUtils.cpp:581