GemaCoreLib
The GeMA Core library
gmCellGeometry.h
Go to the documentation of this file.
1 /************************************************************************
2 **
3 ** Copyright (C) 2014 by Carlos Augusto Teixera Mendes
4 ** All rights reserved.
5 **
6 ** This file is part of the "GeMA" software. It's use should respect
7 ** the terms in the license agreement that can be found together
8 ** with this source code.
9 ** It is provided AS IS, with NO WARRANTY OF ANY KIND,
10 ** INCLUDING THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR
11 ** A PARTICULAR PURPOSE.
12 **
13 ************************************************************************/
14 
24 #ifndef _GEMA_CELL_GEOMETRY_H_
25 #define _GEMA_CELL_GEOMETRY_H_
26 
27 #include "gmCoreConfig.h"
28 #include "gmMatrix.h"
29 #include "gmVector.h"
30 
31 #include <QAtomicPointer>
32 #include <QMutex>
33 
34 #include "gmCellType.h"
35 #include "gmCellGeometryInfo.h"
36 
37 class GmIntegrationRule;
38 
55 {
56 public:
63  GmCellGeometry(GmCellType type, int P = 0, int Q = 0)
64  : _info(_infoRegistry[type]), _P(P), _Q(Q)
65  {
66  assert(type < GM_NUM_CELL_TYPES);
67  assert(_info);
68  }
69 
71  GmCellType type() const { return _info->_type; }
72 
74  const char* typeName() const { return _info->_name; }
75 
77  GmCellFamilyType family() const { return _info->_family; }
78 
80  bool isInterface() const { return _info->_interface; }
81 
83  bool isHierarchical() const { return _info->_hierarchical; }
84 
86  int order() const { return _info->_order; }
87 
89  GmCellType linearElement() const { return _info->_eqLinearType; }
90 
92  int numNodes() const { return _info->_nnodes; }
93 
103  int numVertices() const { return _info->_nvertices; }
104 
108  int numExtraDofNodes() const { return _info->_nextraDofNodes; }
109 
111  int numCoord() const { return _info->_ncoord; }
112 
114  int numEdges() const { return _info->_nedges; }
115 
117  int numFaces() const { return _info->_nfaces; }
118 
120  bool isLine() const { return numFaces() == 0; }
121 
123  bool isSurface() const { return numFaces() == 1; }
124 
126  bool isSolid() const { return numFaces() > 1; }
127 
129  int numEdgeNodes(int edgeIndex) const
130  {
131  assert(edgeIndex >= 0 && edgeIndex < numEdges());
132  return _info->_edgeNodeInfo[edgeIndex]._edgeNodes.size();
133  }
134 
141  int edgeNode(int edgeIndex, int i) const
142  {
143  assert(i >= 0 && i < numEdgeNodes(edgeIndex));
144  return _info->_edgeNodeInfo[edgeIndex]._edgeNodes[i];
145  }
146 
150  int firstEdgeNode(int edgeIndex) const
151  {
152  assert(edgeIndex >= 0 && edgeIndex < numEdges());
153  return _info->_edgeNodeInfo[edgeIndex]._edgeNodes.first();
154  }
155 
159  int lastEdgeNode(int edgeIndex) const
160  {
161  assert(edgeIndex >= 0 && edgeIndex < numEdges());
162  return _info->_edgeNodeInfo[edgeIndex]._edgeNodes.last();
163  }
164 
166  bool nodeOnEdge(int nodeIndex, int edgeIndex) const
167  {
168  assert(nodeIndex >= 0 && nodeIndex < numNodes());
169  assert(edgeIndex >= 0 && edgeIndex < numEdges());
170  return _info->_edgeNodeInfo[edgeIndex]._edgeNodes.indexOf(nodeIndex) >= 0;
171  }
172 
177  int edgeFromNodes(int n1, int n2) const
178  {
179  assert(n1 >= 0 && n1 < numNodes() && n2 >= 0 && n2 < numNodes());
180  for(int e = 0; e < numEdges(); e++)
181  {
182  int en1 = _info->_edgeNodeInfo[e]._edgeNodes.first();
183  int en2 = _info->_edgeNodeInfo[e]._edgeNodes.last();
184  if((n1 == en1 && n2 == en2) || (n1 == en2 && n2 == en1))
185  return e;
186  }
187  return -1;
188  }
189 
191  int numFaceEdges(int faceIndex) const
192  {
193  assert(faceIndex >= 0 && faceIndex < numFaces());
194  return _info->_faceEdgeInfo[faceIndex].size();
195  }
196 
203  int faceEdge(int faceIndex, int i) const
204  {
205  assert(i >= 0 && i < numFaceEdges(faceIndex));
206  return _info->_faceEdgeInfo[faceIndex][i];
207  }
208 
210  int numEdgeFaces(int edgeIndex) const
211  {
212  assert(edgeIndex >= 0 && edgeIndex < numEdges());
213  return _info->_edgeFaceInfo[edgeIndex].size();
214  }
215 
222  int edgeFace(int edgeIndex, int i) const
223  {
224  assert(i >= 0 && i < numEdgeFaces(edgeIndex));
225  return _info->_edgeFaceInfo[edgeIndex][i];
226  }
227 
231  int numFaceBoundaryNodes(int faceIndex) const
232  {
233  assert(faceIndex >= 0 && faceIndex < numFaces());
234  return _info->_faceNodeInfo[faceIndex]._nboundaryNodes;
235  }
236 
238  int numFaceNodes(int faceIndex) const
239  {
240  assert(faceIndex >= 0 && faceIndex < numFaces());
241  return _info->_faceNodeInfo[faceIndex]._faceNodes.size();
242  }
243 
252  int faceNode(int faceIndex, int i) const
253  {
254  assert(i >= 0 && i < numFaceNodes(faceIndex));
255  return _info->_faceNodeInfo[faceIndex]._faceNodes[i];
256  }
257 
259  int numIncidenceNodes(int nodeIndex) const
260  {
261  assert(nodeIndex >= 0 && nodeIndex < numNodes());
262  return _info->_nodeIncidenceInfo[nodeIndex].size();
263  }
264 
271  int incidenceNode(int nodeIndex, int i) const
272  {
273  assert(i >= 0 && i < numIncidenceNodes(nodeIndex));
274  return _info->_nodeIncidenceInfo[nodeIndex][i];
275  }
276 
278  int numVolumeInternalNodes() const { return _info->_volumeNodeInfo.size(); }
279 
285  int volumeInternalNode(int i) const
286  {
287  assert(i >= 0 && i < numVolumeInternalNodes());
288  return _info->_volumeNodeInfo[i];
289  }
290 
298  int numFaceTypes() const { return _info->_nfaceTypes; }
299 
301  GmCellFaceType faceType(int faceIndex) const
302  {
303  int nedges = numFaceEdges(faceIndex);
304  assert(nedges == 3 || nedges == 4);
305  return (nedges == 3 ? GM_TRI_FACE : GM_QUAD_FACE);
306  }
307 
312  GmCellType edgeElement(int edgeIndex) const
313  {
314  assert(edgeIndex >= 0 && edgeIndex < numEdges());
315  GmCellType barType = _info->_edgeNodeInfo[edgeIndex]._eqEdgeType;
316  assert(barType == GM_INV_CELL_TYPE ||
317  (GmCellGeometry(barType).isLine() &&
318  GmCellGeometry(barType).numNodes() == numEdgeNodes(edgeIndex) &&
319  GmCellGeometry(barType).numCoord() == numCoord()));
320  return barType;
321  }
322 
327  GmCellType faceElement(int faceIndex) const
328  {
329  assert(faceIndex >= 0 && faceIndex < numFaces());
330  GmCellType faceType = _info->_faceNodeInfo[faceIndex]._eqFaceType;
331  assert(faceType == GM_INV_CELL_TYPE ||
332  (GmCellGeometry(faceType).isSurface() &&
333  GmCellGeometry(faceType).numNodes() == numFaceNodes(faceIndex) &&
334  GmCellGeometry(faceType).numCoord() == numCoord()));
335  return faceType;
336  }
337 
348  int edgeElementNode(int edgeIndex, int i) const
349  {
350  assert(edgeElement(edgeIndex) != GM_INV_CELL_TYPE);
351  assert(i >= 0 && i < GmCellGeometry(edgeElement(edgeIndex)).numNodes());
352  static int bar3NodeTranslation[3] = { 0, 2, 1 }; // Edge ordering to Bar3 ordering
353  if(numEdgeNodes(edgeIndex) == 2)
354  return edgeNode(edgeIndex, i);
355  else
356  return edgeNode(edgeIndex, bar3NodeTranslation[i]);
357  }
358 
369  int faceElementNode(int faceIndex, int i) const
370  {
371  assert(faceElement(faceIndex) != GM_INV_CELL_TYPE);
372  assert(i >= 0 && i < GmCellGeometry(faceElement(faceIndex)).numNodes());
373  return _info->_faceNodeInfo[faceIndex]._faceTypeNodes[i];
374  }
375 
377  GmCellType edgeLinearElement(int edgeIndex) const { return GmCellGeometry(linearElement()).edgeElement(edgeIndex); }
378 
380  GmCellType faceLinearElement(int faceIndex) const { return GmCellGeometry(linearElement()).faceElement(faceIndex); }
381 
383  static int maxNumNodes() { return _maxNumNodes; }
384 
385  static const char* familyTypeToStr(GmCellFamilyType family);
386  static int strToFamilyType(QString str);
387 
388  static const char* faceTypeToStr(GmCellFaceType type);
389  static int strToFaceType(QString str);
390 
400  double length(const GmMatrix& X) const
401  {
402  checkX(X);
403  if(isSolid() || (isSurface() && !isInterface()))
404  return 0.0;
405  return _info->dimension(X);
406  }
407 
417  double area(const GmMatrix& X) const
418  {
419  checkX(X);
420  if(isLine() || (isSurface() && isInterface()) || (isSolid() && !isInterface()))
421  return 0.0;
422  return _info->dimension(X);
423  }
424 
432  double volume(const GmMatrix& X) const
433  {
434  checkX(X);
435  if(!isSolid() || isInterface())
436  return 0.0;
437  return _info->dimension(X);
438  }
439 
444  double characteristicLength(const GmMatrix& X) const
445  {
446  checkX(X);
447  if(isLine() || (isSurface() && isInterface()))
448  return _info->dimension(X);
449  else if(isSurface() || (isSolid() && isInterface()))
450  return std::sqrt(_info->dimension(X));
451  else
452  return std::pow(_info->dimension(X), 1.0/3.0);
453  }
454 
459  double characteristicDimension(const GmMatrix& X) const { checkX(X); return _info->dimension(X); }
460 
477  void centroidCartesian(const GmMatrix& X, GmVector& coord) const { checkX(X); return _info->centroidCartesian(X, coord); }
478 
479  // Capability related methods.
480  //------------------------------------------------------------------------------------
481 
489  {
490  assert(capability >= 0 && capability < GM_CELL_GEOMETRY_CAPABILITY_COUNT);
491  return _info->_capabilities[capability];
492  }
493 
499  bool isValid(const GmMatrix& X, double tol) const { checkX(X); return _info->isValid(X, tol); }
500 
506  double quality(const GmMatrix& J, double tol) const { return _info->quality(J, tol); }
507 
513  bool contains(const GmMatrix& X, const GmVector& coord) const { checkX(X); return _info->contains(X, coord); }
514 
515  //------------------------------------------------------------------------------------
516  // CellGeometryInfo registering and query functions. Not for general use
517  //------------------------------------------------------------------------------------
518 
519  static void registerCellType(const GmCellGeometryInfo* cellInfo);
520 
523  {
524  assert(type > 0 && type < GM_NUM_CELL_TYPES);
525  return _infoRegistry[type];
526  }
527 
528  //------------------------------------------------------------------------------------
529  // Shape & Integration rule factory functions.
530  // Marked as private and accessed by selected friend classes since they should NOT be
531  // used by regular code. Shape functions and integration rules should be obtained through
532  // the Shape and IntegrationRule factories.
533  //------------------------------------------------------------------------------------
534 
535 private:
536  friend class GmShape;
537  friend class GmIntegrationRule;
538  friend class GmBorderIntegrationRule;
539 
545  {
546  assert((!_info->_hierarchical && _P == 0 && _Q == 0) || (_info->_hierarchical && _P > 0 && _Q > 0));
547  return _info->shapeInstance(_P, _Q);
548  }
549 
563  GmIntegrationRule* integrationRule(GmIntegrationRuleType irType, int rule1 = -1, int rule2 = -1, int rule3 = -1) const
564  {
565  assert((!_info->_hierarchical && _P == 0 && _Q == 0) || (_info->_hierarchical && _P > 0 && _Q > 0));
566  return _info->integrationRule(irType, rule1, rule2, rule3, _P, _Q);
567  }
568 
585  {
586  assert((!_info->_hierarchical && _P == 0 && _Q == 0) || (_info->_hierarchical && _P > 0 && _Q > 0));
587  return _info->edgeIntegrationRule(irType, rule1, _P, _Q);
588  }
589 
611  GmBorderIntegrationRule* faceIntegrationRule(int faceType, GmIntegrationRuleType irType, int rule1 = -1, int rule2 = -1) const
612  {
613  assert((!_info->_hierarchical && _P == 0 && _Q == 0) || (_info->_hierarchical && _P > 0 && _Q > 0));
614  return _info->faceIntegrationRule(faceType, irType, rule1, rule2, _P, _Q);
615  }
616 
627  GmBorderIntegrationRule* borderIntegrationRule(int faceType, GmIntegrationRuleType irType, int rule1 = -1, int rule2 = -1) const
628  {
629  if(isSurface())
630  return edgeIntegrationRule(irType, rule1);
631  else if(isSolid())
632  return faceIntegrationRule(faceType, irType, rule1, rule2);
633  else // line
634  return NULL;
635  }
636 
637 private:
638  inline void checkX(const GmMatrix& X) const { Q_UNUSED(X); assert(X.n_cols == numNodes() && X.n_rows == numCoord()); }
639 
640 #ifndef NDEBUG
641  static void checkMetadata(const GmCellGeometryMetadata* data, bool registryFullyInitialised);
642  static void checkGeometryIEFCompatibility(GmCellType type);
643  static void checkElementRegistry();
644 #endif
645 
647  int _P, _Q;
648 
649  static const GmCellGeometryInfo* _infoRegistry[GM_NUM_CELL_TYPES];
650  static int _maxNumNodes;
651 };
652 
653 
654 
655 #endif
656 
GmIntegrationRuleType
The type of desired integration rule (Gauss quadrature, Lobatto quadrature, etc)
Definition: gmIntegrationRule.h:67
int numFaceEdges(int faceIndex) const
Returns the number of edges in the cell's face numbered faceIndex (faceIndex from 0 to numFaces()-1)
Definition: gmCellGeometry.h:191
int faceEdge(int faceIndex, int i) const
Returns the ith edge belonging to face faceIndex.
Definition: gmCellGeometry.h:203
bool hasCapability(GmCellGeometryCapabilities capability) const
Returns true if this cell type implements the geometric related capability described by the given par...
Definition: gmCellGeometry.h:488
int numVolumeInternalNodes() const
Returns the number of internal nodes of this volume's cell type. Returns 0 for 1d/2d cells.
Definition: gmCellGeometry.h:278
void centroidCartesian(const GmMatrix &X, GmVector &coord) const
Fills the coord vector with the cartesian coordinates of the cell centroid, with nodes defined by the...
Definition: gmCellGeometry.h:477
bool isSurface() const
Is this element an 2D "surface".
Definition: gmCellGeometry.h:123
int _Q
The P & Q parameters for hierarchical element types. 0 otherwise.
Definition: gmCellGeometry.h:647
GmCellType edgeLinearElement(int edgeIndex) const
Returns the equivalent linear element of the given element's edge.
Definition: gmCellGeometry.h:377
GmCellGeometry(GmCellType type, int P=0, int Q=0)
Constructor. Receives the cell type for which geometry information will be returned....
Definition: gmCellGeometry.h:63
int lastEdgeNode(int edgeIndex) const
Returns the last node in the cell's edge numbered edgeIndex (edgeIndex from 0 to numEdges()-1) Equiva...
Definition: gmCellGeometry.h:159
int numFaceTypes() const
Returns the number of face types for a 3D element (generally 1), 1 for 2D elements and 0 for 1D eleme...
Definition: gmCellGeometry.h:298
int numFaces() const
Returns the number of faces of this cell type (0 for "bar" alike cells, 1 for surface cells)
Definition: gmCellGeometry.h:117
GmCellFaceType
The type of a 3D element's face.
Definition: gmCellType.h:135
NOT a cell type. Stores the number of available types.
Definition: gmCellType.h:77
int numIncidenceNodes(int nodeIndex) const
Returns the number of incident nodes into the cell's node numbered nodeIndex (nodeIndex from 0 to num...
Definition: gmCellGeometry.h:259
Declaration of usefull configuration definitions for the Core library.
GmShape * shapeInstance() const
Shape function factory. Returns a NEW instance of the shape function object for this type....
Definition: gmCellGeometry.h:544
int firstEdgeNode(int edgeIndex) const
Returns the first node in the cell's edge numbered edgeIndex (edgeIndex from 0 to numEdges()-1) Equiv...
Definition: gmCellGeometry.h:150
Declaration of the GmCellType enum.
int incidenceNode(int nodeIndex, int i) const
Returns the ith incidence node belonging to node nodeIndex.
Definition: gmCellGeometry.h:271
GmBorderIntegrationRule * faceIntegrationRule(int faceType, GmIntegrationRuleType irType, int rule1=-1, int rule2=-1) const
A factory function that returns a NEW border integration rule object suited for this kind of element....
Definition: gmCellGeometry.h:611
static int maxNumNodes()
A static function that returns the maximum number of nodes among all known cell types.
Definition: gmCellGeometry.h:383
int edgeNode(int edgeIndex, int i) const
Returns the ith node belonging to edge edgeIndex.
Definition: gmCellGeometry.h:141
int numFaceBoundaryNodes(int faceIndex) const
Returns the number of boundary nodes in the cell's face numbered faceIndex (faceIndex from 0 to numFa...
Definition: gmCellGeometry.h:231
int order() const
Returns the cell interpolation order(1 = linear, 2 = quadratic, 3 = cubic, ...)
Definition: gmCellGeometry.h:86
Declaration of the GmMatrix class.
double characteristicDimension(const GmMatrix &X) const
Returns the cell characteristic dimension, defined as the length for 1D and 2D interface elements,...
Definition: gmCellGeometry.h:459
int numEdges() const
Returns the number of edges of this cell type.
Definition: gmCellGeometry.h:114
bool isInterface() const
Returns true if this is an interface element, false otherwise.
Definition: gmCellGeometry.h:80
GmCellType edgeElement(int edgeIndex) const
Returns the type of the equivalent Bar element (with either 2D or 3D coordinates) for an elements edg...
Definition: gmCellGeometry.h:312
Not a capability type. Stores the number of capabilities in the enum.
Definition: gmCellGeometryInfo.h:53
GmBorderIntegrationRule * borderIntegrationRule(int faceType, GmIntegrationRuleType irType, int rule1=-1, int rule2=-1) const
Returns a NEW border integration rule object suited for this kind of element. Border rules are used t...
Definition: gmCellGeometry.h:627
A class used to return static metadata information about a cell geometry, along with some methods for...
Definition: gmCellGeometry.h:54
double quality(const GmMatrix &J, double tol) const
Returns a normalized quality measure of the cell geometry, from 0 to 1, where 0.0 means very bad and ...
Definition: gmCellGeometry.h:506
bool isLine() const
Is this element an 1D "line" ?
Definition: gmCellGeometry.h:120
Integration rule base classe.
Definition: gmIntegrationRule.h:88
Shape function handling base classe.
Definition: gmShape.h:37
bool contains(const GmMatrix &X, const GmVector &coord) const
Returns true if the cell contains the point specified by the given cartesian coordinates 'coord'....
Definition: gmCellGeometry.h:513
static const GmCellGeometryInfo * geometryInfo(GmCellType type)
Returns the geometry info objct associated with type. NOT FOR GENERAL USE.
Definition: gmCellGeometry.h:522
int edgeFromNodes(int n1, int n2) const
Returns the edge index of the edge starting with n1 and ending with n2 or vice-versa....
Definition: gmCellGeometry.h:177
GmBorderIntegrationRule * edgeIntegrationRule(GmIntegrationRuleType irType, int rule1=-1) const
A factory function that returns a NEW border integration rule object suited for this kind of element....
Definition: gmCellGeometry.h:584
int numEdgeFaces(int edgeIndex) const
Returns the number of faces in the cell's edge numbered edgeIndex (edgeIndex from 0 to numEdges()-1)
Definition: gmCellGeometry.h:210
The element face is a quadrilateral.
Definition: gmCellType.h:137
GmCellGeometryCapabilities
An enum storing the possible geometric capabilities for a cell geometry info type that can be queried...
Definition: gmCellGeometryInfo.h:42
bool isHierarchical() const
Returns true if this is a hierarchical element, false otherwise.
Definition: gmCellGeometry.h:83
Border integration rule base classe.
Definition: gmBorderIntegrationRule.h:37
double volume(const GmMatrix &X) const
Returns the volume of a 3D element with nodes defined by the X matrix (with node coordinates organize...
Definition: gmCellGeometry.h:432
int edgeFace(int edgeIndex, int i) const
Returns the ith face belonging to edge edgeIndex.
Definition: gmCellGeometry.h:222
bool isSolid() const
Is this element an 3D "solid"?
Definition: gmCellGeometry.h:126
const char * typeName() const
Returns the type name.
Definition: gmCellGeometry.h:74
static int _maxNumNodes
The maximum number of nodes among all registered cell types.
Definition: gmCellGeometry.h:650
bool nodeOnEdge(int nodeIndex, int edgeIndex) const
Returns true if the given (local) node index belongs to the given edge definition.
Definition: gmCellGeometry.h:166
double characteristicLength(const GmMatrix &X) const
Returns the cell characteristic length, defined as the length for 1D and 2D interface elements,...
Definition: gmCellGeometry.h:444
int numEdgeNodes(int edgeIndex) const
Returns the number of nodes in the cell's edge numbered edgeIndex (edgeIndex from 0 to numEdges()-1)
Definition: gmCellGeometry.h:129
GmCellFaceType faceType(int faceIndex) const
Returns the face type for the cells face numbered faceIndex (faceIndex from 0 to numFaces()-1)
Definition: gmCellGeometry.h:301
GmCellType faceLinearElement(int faceIndex) const
Returns the equivalent linear element of the given element's face.
Definition: gmCellGeometry.h:380
int numVertices() const
Returns the number of vertices of this cell type. This excludes center edge and face nodes - returns ...
Definition: gmCellGeometry.h:103
Declaration of the GmVector class.
#define GMC_API_EXPORT
Macro for controling if the class is being exported (GEMA_CORE_LIB defined) or imported (GEMA_CORE_LI...
Definition: gmCoreConfig.h:35
The element face is a triangle.
Definition: gmCellType.h:138
GmCellType
Mesh Cell types. Don't change type orders or add types without reading comments below.
Definition: gmCellType.h:30
int volumeInternalNode(int i) const
Returns the ith internal node belonging to the volume.
Definition: gmCellGeometry.h:285
GmCellType linearElement() const
Returns the type of the equivalent linear element (for a Quad9, returns a Quad4, for example).
Definition: gmCellGeometry.h:89
bool isValid(const GmMatrix &X, double tol) const
Definition: gmCellGeometry.h:499
GmCellFamilyType family() const
Returns the family to which this cell type belongs.
Definition: gmCellGeometry.h:77
int numFaceNodes(int faceIndex) const
Returns the number of nodes in the cell's face numbered faceIndex (faceIndex from 0 to numFaces()-1)
Definition: gmCellGeometry.h:238
int faceElementNode(int faceIndex, int i) const
Returns the ith node belonging to the face faceIndex using the equivalent surface element (returned b...
Definition: gmCellGeometry.h:369
Definition: gmCellGeometryInfo.h:153
int numExtraDofNodes() const
Returns the number of extra degrees of freedom (dof) nodes. This is usually 0, except for some kinds ...
Definition: gmCellGeometry.h:108
GmCellType type() const
Return the cell type associated to this object.
Definition: gmCellGeometry.h:71
GmCellType faceElement(int faceIndex) const
Returns the type of the equivalent surface element (with 3D node coordinates) for a 3D element's face...
Definition: gmCellGeometry.h:327
double length(const GmMatrix &X) const
Returns the length of a bar element with nodes defined by the X matrix (with node coordinates organiz...
Definition: gmCellGeometry.h:400
NOT a cell type. Defines a marker for an invalid cell type.
Definition: gmCellType.h:78
int faceNode(int faceIndex, int i) const
Returns the ith node belonging to the face faceIndex. Since boundary nodes are always returned first ...
Definition: gmCellGeometry.h:252
Declaration of the GmCellGeometryInfo base class.
int numCoord() const
Returns the size of the cartesian coordinates for this cell type.
Definition: gmCellGeometry.h:111
arma::vec GmVector
The basic type for a GeMA vector object. Currently based on an Armadillo vector.
Definition: gmVector.h:34
GmIntegrationRule * integrationRule(GmIntegrationRuleType irType, int rule1=-1, int rule2=-1, int rule3=-1) const
A factory function that returns a NEW integration rule object suited for this kind of element.
Definition: gmCellGeometry.h:563
arma::mat GmMatrix
The basic type for a GeMA matrix object. Currently based on an Armadillo matrix.
Definition: gmMatrix.h:38
const GmCellGeometryInfo * _info
The pointer to the cell geometry info object storing the cell type metadata.
Definition: gmCellGeometry.h:646
GmCellFamilyType
Mesh cell type families. Use to group all quad, tri, etc elements in a "family". Its start value is a...
Definition: gmCellType.h:106
Plane structure storing the full set of geometric metadata for a cell type.
Definition: gmCellGeometryInfo.h:57
int edgeElementNode(int edgeIndex, int i) const
Returns the ith node belonging to the edge edgeIndex using the equivalent linear element (returned by...
Definition: gmCellGeometry.h:348
int numNodes() const
Returns the total number of nodes of this cell type.
Definition: gmCellGeometry.h:92
double area(const GmMatrix &X) const
Returns the area of a 2D element with nodes defined by the X matrix (with node coordinates organized ...
Definition: gmCellGeometry.h:417