GemaCoreLib
The GeMA Core library
Loading...
Searching...
No Matches
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
38
55{
56public:
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
213 int numEdgeFaces(int edgeIndex) const
214 {
215 assert(edgeIndex >= 0 && edgeIndex < numEdges());
216 return _info->_edgeFaceInfo[edgeIndex].size();
217 }
218
225 int edgeFace(int edgeIndex, int i) const
226 {
227 assert(i >= 0 && i < numEdgeFaces(edgeIndex));
228 return _info->_edgeFaceInfo[edgeIndex][i];
229 }
230
234 int numFaceBoundaryNodes(int faceIndex) const
235 {
236 assert(faceIndex >= 0 && faceIndex < numFaces());
237 return _info->_faceNodeInfo[faceIndex]._nboundaryNodes;
238 }
239
241 int numFaceNodes(int faceIndex) const
242 {
243 assert(faceIndex >= 0 && faceIndex < numFaces());
244 return _info->_faceNodeInfo[faceIndex]._faceNodes.size();
245 }
246
255 int faceNode(int faceIndex, int i) const
256 {
257 assert(i >= 0 && i < numFaceNodes(faceIndex));
258 return _info->_faceNodeInfo[faceIndex]._faceNodes[i];
259 }
260
262 int numIncidenceNodes(int nodeIndex) const
263 {
264 assert(nodeIndex >= 0 && nodeIndex < numNodes());
265 return _info->_nodeIncidenceInfo[nodeIndex].size();
266 }
267
274 int incidenceNode(int nodeIndex, int i) const
275 {
276 assert(i >= 0 && i < numIncidenceNodes(nodeIndex));
277 return _info->_nodeIncidenceInfo[nodeIndex][i];
278 }
279
281 int numVolumeInternalNodes() const { return _info->_volumeNodeInfo.size(); }
282
288 int volumeInternalNode(int i) const
289 {
290 assert(i >= 0 && i < numVolumeInternalNodes());
291 return _info->_volumeNodeInfo[i];
292 }
293
301 int numFaceTypes() const { return _info->_nfaceTypes; }
302
304 GmCellFaceType faceType(int faceIndex) const
305 {
306 int nedges = numFaceEdges(faceIndex);
307 assert(nedges == 3 || nedges == 4);
308 return (nedges == 3 ? GM_TRI_FACE : GM_QUAD_FACE);
309 }
310
318 GmCellType edgeElement(int edgeIndex, bool mesh = false) const
319 {
320 assert(edgeIndex >= 0 && edgeIndex < numEdges());
321 GmCellType barType = mesh ? _info->_edgeNodeInfo[edgeIndex]._meshEdgeType :
322 _info->_edgeNodeInfo[edgeIndex]._eqEdgeType;
323 assert(barType == GM_INV_CELL_TYPE ||
324 (GmCellGeometry(barType).isLine() &&
325 GmCellGeometry(barType).numCoord() == numCoord() &&
326 (mesh || GmCellGeometry(barType).numNodes() == numEdgeNodes(edgeIndex))));
327 return barType;
328 }
329
337 GmCellType faceElement(int faceIndex, bool mesh = false) const
338 {
339 assert(faceIndex >= 0 && faceIndex < numFaces());
340 GmCellType faceType = mesh ? _info->_faceNodeInfo[faceIndex]._meshFaceType :
341 _info->_faceNodeInfo[faceIndex]._eqFaceType;
342 assert(faceType == GM_INV_CELL_TYPE ||
343 (GmCellGeometry(faceType).isSurface() &&
344 GmCellGeometry(faceType).numCoord() == numCoord() &&
345 (mesh || GmCellGeometry(faceType).numNodes() == numFaceNodes(faceIndex))));
346 return faceType;
347 }
348
361 int edgeElementNode(int edgeIndex, int i, bool mesh = false) const
362 {
363 Q_UNUSED(mesh);
364 assert(edgeElement(edgeIndex, mesh) != GM_INV_CELL_TYPE);
365 assert(i >= 0 && i < GmCellGeometry(edgeElement(edgeIndex, mesh)).numNodes());
366 if(i == 0)
367 return firstEdgeNode(edgeIndex);
368 else if(i == 1)
369 return lastEdgeNode(edgeIndex);
370 else
371 {
372 assert(i == 2 && (mesh || numEdgeNodes(edgeIndex) == 3));
373 return numEdgeNodes(edgeIndex) == 3 ? edgeNode(edgeIndex, 1) : -1;
374 }
375 }
376
392 int faceElementNode(int faceIndex, int i, bool mesh = false) const
393 {
394 assert(faceElement(faceIndex, mesh) != GM_INV_CELL_TYPE);
395 assert(i >= 0 && i < GmCellGeometry(faceElement(faceIndex, mesh)).numNodes());
396 return mesh ? _info->_faceNodeInfo[faceIndex]._meshTypeNodes[i] :
397 _info->_faceNodeInfo[faceIndex]._faceTypeNodes[i];
398 }
399
401 GmCellType edgeLinearElement(int edgeIndex, bool mesh = false) const { return GmCellGeometry(linearElement()).edgeElement(edgeIndex, mesh); }
402
404 GmCellType faceLinearElement(int faceIndex, bool mesh = false) const { return GmCellGeometry(linearElement()).faceElement(faceIndex, mesh); }
405
410 int numInterfaceContactSides() const { return _info->_interfaceInfo._contactSides.size(); }
411
415 int interfaceContactSide(int i) const
416 {
417 assert(i >= 0 && i < numInterfaceContactSides());
418 return _info->_interfaceInfo._contactSides[i];
419 }
420
425 int numInterfaceApertureSides() const { return _info->_interfaceInfo._apertureSides.size(); }
426
430 int interfaceApertureSide(int i) const
431 {
432 assert(i >= 0 && i < numInterfaceApertureSides());
433 return _info->_interfaceInfo._apertureSides[i];
434 }
435
441 int numInterfaceContactEdges(int faceIndex) const
442 {
443 assert(faceIndex >= 0 && faceIndex < numFaces());
444 return _info->_interfaceInfo._contactEdges[faceIndex].size();
445 }
446
453 int interfaceContactEdge(int faceIndex, int i) const
454 {
455 assert(faceIndex >= 0 && faceIndex < numFaces());
456 assert(i >= 0 && i < numInterfaceContactEdges(faceIndex));
457 return _info->_interfaceInfo._contactEdges[faceIndex][i];
458 }
459
465 int numInterfaceApertureEdges(int faceIndex) const
466 {
467 assert(faceIndex >= 0 && faceIndex < numFaces());
468 return _info->_interfaceInfo._apertureEdges[faceIndex].size();
469 }
470
477 int interfaceApertureEdge(int faceIndex, int i) const
478 {
479 assert(faceIndex >= 0 && faceIndex < numFaces());
480 assert(i >= 0 && i < numInterfaceApertureEdges(faceIndex));
481 return _info->_interfaceInfo._apertureEdges[faceIndex][i];
482 }
483
485 static int maxNumNodes() { return _maxNumNodes; }
486
487 static const char* familyTypeToStr(GmCellFamilyType family);
488 static int strToFamilyType(QString str);
489
490 static const char* faceTypeToStr(GmCellFaceType type);
491 static int strToFaceType(QString str);
492
493 static int name2Type(const QString name) {
494 static QHash<QString, int> nameToType;
495 static QMutex mtx;
496 //build entries
497 if(nameToType.size() != GM_NUM_CELL_TYPES) {
498 mtx.lock();
499 //In case it was being built while we entered the previous if-clause
500 if(nameToType.isEmpty()) {
501 for(int i = 0; i < GM_NUM_CELL_TYPES; ++i) {
502 nameToType[_infoRegistry[i]->_name] = i;
503 }
504 }
505 mtx.unlock();
506 }
507 assert(nameToType.size() == GM_NUM_CELL_TYPES);
508 auto it = nameToType.find(name);
509 if(it == nameToType.end()) {
510 return -1;
511 }
512 return it.value();
513 }
514
515 static const char* type2Name(GmCellType t) {
516 return _infoRegistry[t]->_name;
517 }
518
528 double length(const GmMatrix& X) const
529 {
530 checkX(X);
531 if(isSolid() || (isSurface() && !isInterface()))
532 return 0.0;
533 return _info->dimension(X);
534 }
535
545 double area(const GmMatrix& X) const
546 {
547 checkX(X);
548 if(isLine() || (isSurface() && isInterface()) || (isSolid() && !isInterface()))
549 return 0.0;
550 return _info->dimension(X);
551 }
552
560 double volume(const GmMatrix& X) const
561 {
562 checkX(X);
563 if(!isSolid() || isInterface())
564 return 0.0;
565 return _info->dimension(X);
566 }
567
572 double characteristicLength(const GmMatrix& X) const
573 {
574 checkX(X);
575 if(isLine() || (isSurface() && isInterface()))
576 return _info->dimension(X);
577 else if(isSurface() || (isSolid() && isInterface()))
578 return std::sqrt(_info->dimension(X));
579 else
580 return std::pow(_info->dimension(X), 1.0/3.0);
581 }
582
587 double characteristicDimension(const GmMatrix& X) const { checkX(X); return _info->dimension(X); }
588
598 bool localAxis(const GmMatrix& X, GmMatrix& R) const { checkX(X); return _info->localAxis(X, R); }
599
616 void centroidCartesian(const GmMatrix& X, GmVector& coord) const { checkX(X); return _info->centroidCartesian(X, coord); }
617
618 // Capability related methods.
619 //------------------------------------------------------------------------------------
620
628 {
629 assert(capability >= 0 && capability < GM_CELL_GEOMETRY_CAPABILITY_COUNT);
630 return _info->_capabilities[capability];
631 }
632
638 int isValid(const GmMatrix& X, double tol) const { checkX(X); return _info->isValid(X, tol); }
639
645 double quality(const GmMatrix& J, double tol) const { return _info->quality(J, tol); }
646
652 bool contains(const GmMatrix& X, const GmVector& coord) const { checkX(X); return _info->contains(X, coord); }
653
654 //------------------------------------------------------------------------------------
655 // CellGeometryInfo registering and query functions. Not for general use
656 //------------------------------------------------------------------------------------
657
658 static void registerCellType(const GmCellGeometryInfo* cellInfo);
659
662 {
663 assert(type >= 0 && type < GM_NUM_CELL_TYPES);
664 return _infoRegistry[type];
665 }
666
667 //------------------------------------------------------------------------------------
668 // Shape & Integration rule factory functions.
669 // Marked as private and accessed by selected friend classes since they should NOT be
670 // used by regular code. Shape functions and integration rules should be obtained through
671 // the Shape and IntegrationRule factories.
672 //------------------------------------------------------------------------------------
673
674private:
675 friend class GmShape;
676 friend class GmIntegrationRule;
677 friend class GmBorderIntegrationRule;
678
684 {
685 assert((!_info->_hierarchical && _P == 0 && _Q == 0) || (_info->_hierarchical && _P > 0 && _Q > 0));
686 return _info->shapeInstance(_P, _Q);
687 }
688
702 GmIntegrationRule* integrationRule(GmIntegrationRuleType irType, int rule1 = -1, int rule2 = -1, int rule3 = -1) const
703 {
704 assert((!_info->_hierarchical && _P == 0 && _Q == 0) || (_info->_hierarchical && _P > 0 && _Q > 0));
705 return _info->integrationRule(irType, rule1, rule2, rule3, _P, _Q);
706 }
707
724 {
725 assert((!_info->_hierarchical && _P == 0 && _Q == 0) || (_info->_hierarchical && _P > 0 && _Q > 0));
726 return _info->edgeIntegrationRule(irType, rule1, _P, _Q);
727 }
728
750 GmBorderIntegrationRule* faceIntegrationRule(int faceType, GmIntegrationRuleType irType, int rule1 = -1, int rule2 = -1) const
751 {
752 assert((!_info->_hierarchical && _P == 0 && _Q == 0) || (_info->_hierarchical && _P > 0 && _Q > 0));
753 return _info->faceIntegrationRule(faceType, irType, rule1, rule2, _P, _Q);
754 }
755
766 GmBorderIntegrationRule* borderIntegrationRule(int faceType, GmIntegrationRuleType irType, int rule1 = -1, int rule2 = -1) const
767 {
768 if(isSurface())
769 return edgeIntegrationRule(irType, rule1);
770 else if(isSolid())
771 return faceIntegrationRule(faceType, irType, rule1, rule2);
772 else // line
773 return NULL;
774 }
775
776private:
777 inline void checkX(const GmMatrix& X) const { Q_UNUSED(X); assert(X.n_cols == numNodes() && X.n_rows == numCoord()); }
778
779#ifndef NDEBUG
780 static void checkMetadata(const GmCellGeometryMetadata* data, bool registryFullyInitialised);
781 static void checkGeometryIEFCompatibility(GmCellType type);
782 static void checkElementRegistry();
783#endif
784
786 int _P, _Q;
787
788 static const GmCellGeometryInfo* _infoRegistry[GM_NUM_CELL_TYPES];
789 static int _maxNumNodes;
790};
791
792
793
794#endif
795
Border integration rule base classe.
Definition gmBorderIntegrationRule.h:38
A class used to return static metadata information about a cell geometry, along with some methods for...
Definition gmCellGeometry.h:55
GmCellFamilyType family() const
Returns the family to which this cell type belongs.
Definition gmCellGeometry.h:77
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
double characteristicLength(const GmMatrix &X) const
Returns the cell characteristic length, defined as the length for 1D and 2D interface elements,...
Definition gmCellGeometry.h:572
int numInterfaceApertureSides() const
Returns the number of sides (edges for 2D and faces for 3D) of an interface element that are NOT in c...
Definition gmCellGeometry.h:425
bool isLine() const
Is this element an 1D "line" ?
Definition gmCellGeometry.h:120
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
double characteristicDimension(const GmMatrix &X) const
Returns the cell characteristic dimension, defined as the length for 1D and 2D interface elements,...
Definition gmCellGeometry.h:587
int numEdges() const
Returns the number of edges of this cell type.
Definition gmCellGeometry.h:114
int faceElementNode(int faceIndex, int i, bool mesh=false) const
Returns the ith node belonging to the face faceIndex using the equivalent surface element (returned b...
Definition gmCellGeometry.h:392
static int _maxNumNodes
The maximum number of nodes among all registered cell types.
Definition gmCellGeometry.h:789
GmCellType edgeElement(int edgeIndex, bool mesh=false) const
Returns the type of the equivalent Bar element (with either 2D or 3D coordinates) for an elements edg...
Definition gmCellGeometry.h:318
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:262
int _Q
The P & Q parameters for hierarchical element types. 0 otherwise.
Definition gmCellGeometry.h:786
int numInterfaceContactSides() const
Returns the number of sides (edges for 2D and faces for 3D) of an interface element that are in conta...
Definition gmCellGeometry.h:410
static int maxNumNodes()
A static function that returns the maximum number of nodes among all known cell types.
Definition gmCellGeometry.h:485
static const GmCellGeometryInfo * geometryInfo(GmCellType type)
Returns the geometry info objct associated with type. NOT FOR GENERAL USE.
Definition gmCellGeometry.h:661
int order() const
Returns the cell interpolation order(1 = linear, 2 = quadratic, 3 = cubic, ...)
Definition gmCellGeometry.h:86
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:255
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:616
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:723
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:750
int numInterfaceApertureEdges(int faceIndex) const
Returns the number of aperture edges (edges NOT shared between the interface element with "normal" el...
Definition gmCellGeometry.h:465
int interfaceContactEdge(int faceIndex, int i) const
Returns the local to the face index of the i'th contact edge for the given face (a value between 0 an...
Definition gmCellGeometry.h:453
bool isInterface() const
Returns true if this is an interface element, false otherwise.
Definition gmCellGeometry.h:80
int numVolumeInternalNodes() const
Returns the number of internal nodes of this volume's cell type. Returns 0 for 1d/2d cells.
Definition gmCellGeometry.h:281
int interfaceApertureSide(int i) const
Returns the local element index of the i'th aperture side (edge or face). The parameter i should be i...
Definition gmCellGeometry.h:430
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:528
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
GmShape * shapeInstance() const
Shape function factory. Returns a NEW instance of the shape function object for this type....
Definition gmCellGeometry.h:683
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:301
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
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:766
GmCellType linearElement() const
Returns the type of the equivalent linear element (for a Quad9, returns a Quad4, for example).
Definition gmCellGeometry.h:89
int numInterfaceContactEdges(int faceIndex) const
Returns the number of contact edges (edges shared between the interface element with "normal" element...
Definition gmCellGeometry.h:441
GmCellType faceElement(int faceIndex, bool mesh=false) const
Returns the type of the equivalent surface element (with 3D node coordinates) for a 3D element's face...
Definition gmCellGeometry.h:337
int interfaceContactSide(int i) const
Returns the local element index of the i'th contact side (edge or face). The parameter i should be in...
Definition gmCellGeometry.h:415
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:545
bool isSurface() const
Is this element an 2D "surface".
Definition gmCellGeometry.h:123
GmCellType type() const
Return the cell type associated to this object.
Definition gmCellGeometry.h:71
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:241
int faceEdge(int faceIndex, int i) const
Returns the ith edge belonging to face faceIndex.
Definition gmCellGeometry.h:203
GmCellFaceType faceType(int faceIndex) const
Returns the face type for the cells face numbered faceIndex (faceIndex from 0 to numFaces()-1)
Definition gmCellGeometry.h:304
int numNodes() const
Returns the total number of nodes of this cell type.
Definition gmCellGeometry.h:92
int volumeInternalNode(int i) const
Returns the ith internal node belonging to the volume.
Definition gmCellGeometry.h:288
const GmCellGeometryInfo * _info
The pointer to the cell geometry info object storing the cell type metadata.
Definition gmCellGeometry.h:785
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
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:702
const char * typeName() const
Returns the type name.
Definition gmCellGeometry.h:74
int incidenceNode(int nodeIndex, int i) const
Returns the ith incidence node belonging to node nodeIndex.
Definition gmCellGeometry.h:274
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
bool localAxis(const GmMatrix &X, GmMatrix &R) const
Computes the cell local axis system, with R = [X, Y, Z] and X, Y and Z being the local axis unit vect...
Definition gmCellGeometry.h:598
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:645
int edgeFace(int edgeIndex, int i) const
Returns the ith face incident to the edge edgeIndex.
Definition gmCellGeometry.h:225
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:652
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
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
bool isSolid() const
Is this element an 3D "solid"?
Definition gmCellGeometry.h:126
bool isHierarchical() const
Returns true if this is a hierarchical element, false otherwise.
Definition gmCellGeometry.h:83
GmCellType faceLinearElement(int faceIndex, bool mesh=false) const
Returns the equivalent linear element of the given element's face.
Definition gmCellGeometry.h:404
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
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:234
bool hasCapability(GmCellGeometryCapabilities capability) const
Returns true if this cell type implements the geometric related capability described by the given par...
Definition gmCellGeometry.h:627
int interfaceApertureEdge(int faceIndex, int i) const
Returns the local to the face index of the i'th aperture edge for the given face (a value between 0 a...
Definition gmCellGeometry.h:477
int numCoord() const
Returns the size of the cartesian coordinates for this cell type.
Definition gmCellGeometry.h:111
int edgeNode(int edgeIndex, int i) const
Returns the ith node belonging to edge edgeIndex.
Definition gmCellGeometry.h:141
int edgeElementNode(int edgeIndex, int i, bool mesh=false) const
Returns the ith node belonging to the edge edgeIndex using the equivalent bar element (returned by ed...
Definition gmCellGeometry.h:361
int isValid(const GmMatrix &X, double tol) const
Definition gmCellGeometry.h:638
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:560
GmCellType edgeLinearElement(int edgeIndex, bool mesh=false) const
Returns the equivalent linear element of the given element's edge.
Definition gmCellGeometry.h:401
int numVertices() const
Returns the number of vertices of this cell type. This excludes center edge and face nodes - returns ...
Definition gmCellGeometry.h:103
int numEdgeFaces(int edgeIndex) const
Returns the number of faces incident to the cell's edge numbered edgeIndex (edgeIndex from 0 to numEd...
Definition gmCellGeometry.h:213
Definition gmCellGeometryInfo.h:202
Integration rule base classe.
Definition gmIntegrationRule.h:89
Shape function handling base classe.
Definition gmShape.h:38
Declaration of the GmCellGeometryInfo base class.
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_CAPABILITY_COUNT
Not a capability type. Stores the number of capabilities in the enum.
Definition gmCellGeometryInfo.h:53
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_INV_CELL_TYPE
NOT a cell type. Defines a marker for an invalid cell type.
Definition gmCellType.h:78
@ 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
GmCellFaceType
The type of a 3D element's face.
Definition gmCellType.h:136
@ GM_QUAD_FACE
The element face is a quadrilateral.
Definition gmCellType.h:137
@ GM_TRI_FACE
The element face is a triangle.
Definition gmCellType.h:138
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
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
T & value() const const
QHash::iterator end()
QHash::iterator find(const Key &key)
bool isEmpty() const const
int size() const const
void lock()
void unlock()
Plane structure storing the full set of geometric metadata for a cell type.
Definition gmCellGeometryInfo.h:69