24#ifndef _GEMA_CELL_GEOMETRY_INFO_H_
25#define _GEMA_CELL_GEOMETRY_INFO_H_
33#include <QAtomicPointer>
56enum GmCellGeometryValidity
58 GM_GEOMETRY_STATE_VALID = 0b000000,
59 GM_GEOMETRY_STATE_NON_PLANAR = 0b000001,
60 GM_GEOMETRY_STATE_BAD_ORIENTATION = 0b000010,
61 GM_GEOMETRY_STATE_BAD_EDGE = 0b000100,
62 GM_GEOMETRY_STATE_BAD_FACE_CENTER = 0b001000,
63 GM_GEOMETRY_STATE_SELF_INTERSECT = 0b010000,
64 GM_GEOMETRY_STATE_INVALID_NODES = 0b100000,
323 virtual int isValid(
const GmMatrix& X,
double tol)
const { Q_UNUSED(tol); Q_UNUSED(X);
return GM_GEOMETRY_STATE_VALID; }
334 if (arma::det(J) > tol) {
337 arma::svd_econ(U, s, V, J,
"left");
340 return s[s.n_elem - 1] / s[0];
373template <
class RuleSet,
class RuleSetDefaults>
383 Q_UNUSED(P); Q_UNUSED(Q);
384 return RuleSet::instance<RuleSetDefaults>(
this, irType, rule1, rule2, rule3);
390 Q_UNUSED(irType); Q_UNUSED(rule1); Q_UNUSED(P); Q_UNUSED(Q);
397 Q_UNUSED(faceType); Q_UNUSED(irType); Q_UNUSED(rule1); Q_UNUSED(rule2); Q_UNUSED(P); Q_UNUSED(Q);
406template <
class RuleSet,
class RuleSetDefaults,
class EdgeRuleSet,
class EdgeRuleSetDefaults>
416 Q_UNUSED(P); Q_UNUSED(Q);
417 return RuleSet::instance<RuleSetDefaults>(
this, irType, rule1, rule2, rule3);
423 Q_UNUSED(P); Q_UNUSED(Q);
424 return EdgeRuleSet::edgeInstance<EdgeRuleSetDefaults>(
this, irType, rule1);
430 Q_UNUSED(faceType); Q_UNUSED(irType); Q_UNUSED(rule1); Q_UNUSED(rule2); Q_UNUSED(P); Q_UNUSED(Q);
438template <
class RuleSet,
class RuleSetDefaults,
class EdgeRuleSet,
class EdgeRuleSetDefaults,
class FaceRuleSet,
class FaceRuleSetDefaults>
448 Q_UNUSED(P); Q_UNUSED(Q);
449 return RuleSet::instance<RuleSetDefaults>(
this, irType, rule1, rule2, rule3);
455 Q_UNUSED(P); Q_UNUSED(Q);
456 return EdgeRuleSet::edgeInstance<EdgeRuleSetDefaults>(
this, irType, rule1);
462 Q_UNUSED(P); Q_UNUSED(Q);
463 return FaceRuleSet::faceInstance<FaceRuleSetDefaults>(
this, faceType, irType, rule1, rule2);
Border integration rule base classe.
Definition gmBorderIntegrationRule.h:38
Definition gmCellGeometryInfo.h:202
virtual GmBorderIntegrationRule * edgeIntegrationRule(GmIntegrationRuleType irType, int rule1, int P, int Q) const =0
A factory function that returns a new border integration rule object suited for this kind of element....
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 gmCellGeometryInfo.h:351
virtual GmBorderIntegrationRule * faceIntegrationRule(int faceType, GmIntegrationRuleType irType, int rule1, int rule2, int P, int Q) const =0
A factory function that returns a new border integration rule object suited for this kind of element....
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 gmCellGeometryInfo.h:323
virtual double quality(const GmMatrix &J, double tol) const
Virtual method that should be implemented if this geometry info supports the GM_CELL_GEOMETRY_QUALITY...
Definition gmCellGeometryInfo.h:332
GmCellGeometryInfo(GmCellGeometryMetadata &&metadata)
Standard move constructor receiving the type metadata.
Definition gmCellGeometryInfo.h:208
GmCellGeometryInfo(const GmCellGeometryInfo &other)
Standard copy constructor receiving the type metadata.
Definition gmCellGeometryInfo.h:205
virtual double dimension(const GmMatrix &X) const =0
Virtual function responsible for returning the cell characteristic dimension, defined as the length f...
virtual GmShape * shapeInstance(int P, int Q) const =0
Shape function factory. Should return a NEW instance of the shape function object for this type....
virtual bool localAxis(const GmMatrix &X, GmMatrix &R) const =0
Computes the cell local axis system, with R = [X, Y, Z] and X, Y and Z being the local axis unit vect...
virtual void centroidCartesian(const GmMatrix &X, GmVector &coord) const =0
Virtual function responsible for filling the coord vector with the cartesian coordinates of the cell ...
static QMutex _cellIntegrationRulesMutex
The mutex protecting _cellIntegrationRules.
Definition gmCellGeometryInfo.h:366
virtual GmIntegrationRule * integrationRule(GmIntegrationRuleType irType, int rule1, int rule2, int rule3, int P, int Q) const =0
A factory function that returns a new integration rule object suited for this kind of element.
An auxiliary class that can be used as base for line (bar) elements. Implements the needed integratio...
Definition gmCellGeometryInfo.h:375
virtual GmIntegrationRule * integrationRule(GmIntegrationRuleType irType, int rule1, int rule2, int rule3, int P, int Q) const
Element integration rule factory. See comments on the base class.
Definition gmCellGeometryInfo.h:381
virtual GmBorderIntegrationRule * edgeIntegrationRule(GmIntegrationRuleType irType, int rule1, int P, int Q) const
A factory function that returns a new border integration rule object suited for this kind of element....
Definition gmCellGeometryInfo.h:388
virtual GmBorderIntegrationRule * faceIntegrationRule(int faceType, GmIntegrationRuleType irType, int rule1, int rule2, int P, int Q) const
A factory function that returns a new border integration rule object suited for this kind of element....
Definition gmCellGeometryInfo.h:395
GmCellGeometryInfoLineElement(GmCellGeometryMetadata &&metadata)
Constructor receiving as parameter a metadata object that will be MOVED to the new object.
Definition gmCellGeometryInfo.h:378
An auxiliary class that can be used as base for solid elements. Implements the needed integration rul...
Definition gmCellGeometryInfo.h:440
virtual GmBorderIntegrationRule * faceIntegrationRule(int faceType, GmIntegrationRuleType irType, int rule1, int rule2, int P, int Q) const
A factory function that returns a new border integration rule object suited for this kind of element....
Definition gmCellGeometryInfo.h:460
GmCellGeometryInfoSolidElement(GmCellGeometryMetadata &&metadata)
Constructor receiving as parameter a metadata object that will be MOVED to the new object.
Definition gmCellGeometryInfo.h:443
virtual GmIntegrationRule * integrationRule(GmIntegrationRuleType irType, int rule1, int rule2, int rule3, int P, int Q) const
A factory function that returns a new integration rule object suited for this kind of element.
Definition gmCellGeometryInfo.h:446
virtual GmBorderIntegrationRule * edgeIntegrationRule(GmIntegrationRuleType irType, int rule1, int P, int Q) const
A factory function that returns a new border integration rule object suited for this kind of element....
Definition gmCellGeometryInfo.h:453
An auxiliary class that can be used as base for surface elements. Implements the needed integration r...
Definition gmCellGeometryInfo.h:408
GmCellGeometryInfoSurfaceElement(GmCellGeometryMetadata &&metadata)
Constructor receiving as parameter a metadata object that will be MOVED to the new object.
Definition gmCellGeometryInfo.h:411
virtual GmBorderIntegrationRule * faceIntegrationRule(int faceType, GmIntegrationRuleType irType, int rule1, int rule2, int P, int Q) const
A factory function that returns a new border integration rule object suited for this kind of element....
Definition gmCellGeometryInfo.h:428
virtual GmIntegrationRule * integrationRule(GmIntegrationRuleType irType, int rule1, int rule2, int rule3, int P, int Q) const
A factory function that returns a new integration rule object suited for this kind of element.
Definition gmCellGeometryInfo.h:414
virtual GmBorderIntegrationRule * edgeIntegrationRule(GmIntegrationRuleType irType, int rule1, int P, int Q) const
A factory function that returns a new border integration rule object suited for this kind of element....
Definition gmCellGeometryInfo.h:421
Integration rule base classe.
Definition gmIntegrationRule.h:89
Shape function handling base classe.
Definition gmShape.h:38
GmCellGeometryCapabilities
An enum storing the possible geometric capabilities for a cell geometry info type that can be queried...
Definition gmCellGeometryInfo.h:43
@ GM_CELL_GEOMETRY_CONTAINS
Can the cell geometry info type check wheter a point is inside a cell?
Definition gmCellGeometryInfo.h:50
@ GM_CELL_GEOMETRY_QUALITY
Can the cell geometry info type give a cell quality measure?
Definition gmCellGeometryInfo.h:49
@ GM_CELL_GEOMETRY_CAPABILITY_COUNT
Not a capability type. Stores the number of capabilities in the enum.
Definition gmCellGeometryInfo.h:53
@ GM_CELL_GEOMETRY_VALID
Can the cell geometry info type check if a cell is valid?
Definition gmCellGeometryInfo.h:48
Declaration of the GmCellType enum.
GmCellType
Mesh Cell types. Don't change type orders or add types without reading comments below.
Definition gmCellType.h:31
@ GM_NUM_CELL_TYPES
NOT a cell type. Stores the number of available types.
Definition gmCellType.h:77
GmCellFamilyType
Mesh cell type families. Use to group all quad, tri, etc elements in a "family". Its start value is a...
Definition gmCellType.h:107
Declaration of useful configuration definitions for the Core library.
#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
Declaration of the GmIntegrationRule class and its helper decendants.
GmIntegrationRuleType
The type of desired integration rule (Gauss quadrature, Lobatto quadrature, etc)
Definition gmIntegrationRule.h:68
Declaration of the GmMatrix class.
arma::mat GmMatrix
The basic type for a GeMA matrix object. Currently based on an Armadillo matrix.
Definition gmMatrix.h:38
Declaration of the GmVector class.
arma::vec GmVector
The basic type for a GeMA vector object. Currently based on an Armadillo vector.
Definition gmVector.h:34