GemaCoreLib
The GeMA Core library
gmWedgeCellGeometryInfo.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_WEDGE_CELL_GEOMETRY_INFO_H_
25 #define _GEMA_WEDGE_CELL_GEOMETRY_INFO_H_
26 
27 #include "gmCellGeometryInfo.h"
29 
30 #include "gmGeometryUtils.h"
31 
32 #include "gmWedgeIntegrationRule.h"
33 #include "gmWedgeShape.h"
34 
35 //---------------------------------------------------------
36 // Wedge integration rules
37 //---------------------------------------------------------
38 
42 
46 
50 
51 //---------------------------------------------------------
52 // Wedge6 rule defaults
53 //---------------------------------------------------------
54 
60 
66 
69 
74 
75 //---------------------------------------------------------
76 // Wedge15 rule defaults
77 //---------------------------------------------------------
78 
84 
90 
93 
98 
99 
100 //---------------------------------------------------------
101 // GmWedge6CellGeometryInfo
102 //---------------------------------------------------------
103 
106  : public GmCellGeometryInfoSolidElement<GmWedgeIntegrationRuleSet, GmLinearWedgeIntegrationRuleSetDefaults,
107  GmWedgeEdgeIntegrationRuleSet, GmLinearWedgeEdgeIntegrationRuleSetDefaults,
108  GmWedgeFaceIntegrationRuleSet, GmLinearWedgeFaceIntegrationRuleSetDefaults>
109 {
110 public:
111  static const GmWedge6CellGeometryInfo* instance();
112 
113  // Shape factory. See comments on the base class.
114  virtual GmShape* shapeInstance(int P, int Q) const { Q_UNUSED(P); Q_UNUSED(Q); return new GmWedge6Shape; }
115 
117  virtual double dimension(const GmMatrix& X) const
118  {
119  return GmGeometryUtils::wedgeVolume(X.col(0), X.col(1), X.col(2), X.col(3), X.col(4), X.col(5));
120  }
121 
123  virtual void centroidCartesian(const GmMatrix& X, GmVector& coord) const
124  {
125  GmGeometryUtils::wedgeCentroid(X.col(0), X.col(1), X.col(2), X.col(3), X.col(4), X.col(5), coord);
126  }
127 
128  // --------- Capabilities API ---------
129  virtual bool isValid(const GmMatrix& X, double tol) const {
130  return GmGeometryUtils::wedge6IsWellDefined(X, tol);
131  }
132 private:
138 };
139 
140 //---------------------------------------------------------
141 // GmWedge15CellGeometryInfo
142 //---------------------------------------------------------
143 
146  : public GmCellGeometryInfoSolidElement<GmWedgeIntegrationRuleSet, GmQuadraticWedgeIntegrationRuleSetDefaults,
147  GmWedgeEdgeIntegrationRuleSet, GmQuadraticWedgeEdgeIntegrationRuleSetDefaults,
148  GmWedgeFaceIntegrationRuleSet, GmQuadraticWedgeFaceIntegrationRuleSetDefaults>
149 {
150 public:
151  static const GmWedge15CellGeometryInfo* instance();
152 
153  // Shape factory. See comments on the base class.
154  virtual GmShape* shapeInstance(int P, int Q) const { Q_UNUSED(P); Q_UNUSED(Q); return new GmWedge15Shape; }
155 
157  virtual double dimension(const GmMatrix& X) const { return dimensionByIntegration(X); }
158 
160  virtual void centroidCartesian(const GmMatrix& X, GmVector& coord) const { centroidByIntegration(X, coord); }
161 
162  // --------- Capabilities API ---------
163 
164  virtual bool isValid(const GmMatrix& X, double tol) const {
165  return GmGeometryUtils::wedge15ValidEdges(X) && GmGeometryUtils::wedge6IsWellDefined(X, tol);
166  }
167 private:
173 };
174 
175 
176 #endif
177 
GmCellGeometryIntegrationRuleSet< GmWedgeGaussIntegrationRule, GmCellGeometryNullIntegrationRule, GmCellGeometryNullIntegrationRule, GmCellGeometryNullIntegrationRule > GmWedgeIntegrationRuleSet
The set of possible ELEMENT integration rules, per integration rule type, for the family of Wedge ele...
Definition: gmWedgeCellGeometryInfo.h:41
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
Gauss rules.
Definition: gmIntegrationRule.h:75
virtual double dimension(const GmMatrix &X) const
Returns the Wedge6 volume.
Definition: gmWedgeCellGeometryInfo.h:117
An auxiliary class that can be used as base for solid elements. Implements the needed integration rul...
Definition: gmCellGeometryInfo.h:380
A type used to represent a 'unexistant" integration rule. Should be used as template parameter for Gm...
Definition: gmCellGeometryIntegrationRuleSet.h:35
virtual double dimension(const GmMatrix &X) const
Returns the Wedge15 volume by numeric integration.
Definition: gmWedgeCellGeometryInfo.h:157
GmShape specialization for a Wedge with 6 nodes object.
Definition: gmWedgeShape.h:134
A helper class used to store the default rules for each rule type. Template parameters are the defaul...
Definition: gmCellGeometryIntegrationRuleSet.h:43
A helper class used to store the default rules for elements where the default is expressed by two val...
Definition: gmCellGeometryIntegrationRuleSet.h:142
virtual bool 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: gmWedgeCellGeometryInfo.h:129
The Wedge6 implementation.
Definition: gmWedgeCellGeometryInfo.h:105
GmCellGeometryIntegrationRuleSetDefaultRules< GM_GAUSS_RULE_TYPE, 3, -1, -1, -1 > GmLinearWedgeTriFaceIntegrationRuleSetDefaults
For the Wedge6 FACE rules, we define a rule for triangular faces and a rule for quad faces,...
Definition: gmWedgeCellGeometryInfo.h:64
Shape function handling base classe.
Definition: gmShape.h:37
The Wedge15 implementation.
Definition: gmWedgeCellGeometryInfo.h:145
Declaration of the GmCellGeometryIntegrationRuleSet class & friends.
GmCellGeometryIntegrationRuleSet< GmWedgeGaussEdgeIntegrationRule, GmCellGeometryNullIntegrationRule, GmCellGeometryNullIntegrationRule, GmCellGeometryNullIntegrationRule > GmWedgeEdgeIntegrationRuleSet
The set of possible EDGE integration rules, per integration rule type, for the family of Wedge elemen...
Definition: gmWedgeCellGeometryInfo.h:49
Declaration of the GmWedgeGaussIntegrationRule class, including border rules. Content previously in g...
Gauss integration rule for Wedge element faces.
Definition: gmWedgeIntegrationRule.h:95
Declaration of the 3D wedge shapes inheriting from GmShape class Previosuly part of the gmShape3D....
A helper class used to store the class types for each rule type. Template parameters are the implemen...
Definition: gmCellGeometryIntegrationRuleSet.h:196
GmCellGeometryIntegrationRuleSetDefaultRules< GM_GAUSS_RULE_TYPE, 2, -1, -1, -1 > GmQuadraticWedgeEdgeIntegrationRuleSetDefaults
The set of default rules for a Wedge15 EDGE. Template parameters 2 to 5 are the default rule numbers ...
Definition: gmWedgeCellGeometryInfo.h:97
GmWedge15CellGeometryInfo(GmCellGeometryMetadata &&metadata)
Protected constructor. Only a single Wedge15 geometry info object is ever necessary,...
Definition: gmWedgeCellGeometryInfo.h:169
double wedgeVolume(const GmVector &p1, const GmVector &p2, const GmVector &p3, const GmVector &p4, const GmVector &p5, const GmVector &p6)
Calculates the volume of the given wedge. Points follow the standard Wedge cell definition.
Definition: gmGeometryUtils.cpp:254
GmWedge6CellGeometryInfo(GmCellGeometryMetadata &&metadata)
Protected constructor. Only a single Wedge6 geometry info object is ever necessary,...
Definition: gmWedgeCellGeometryInfo.h:134
Utilitary functions for working with geometry.
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
GmCellGeometryIntegrationRuleSetDefaultRules< GM_GAUSS_RULE_TYPE, 2, -1, -1, -1 > GmLinearWedgeEdgeIntegrationRuleSetDefaults
The set of default rules for a Wedge6 EDGE. Template parameters 2 to 5 are the default rule numbers f...
Definition: gmWedgeCellGeometryInfo.h:73
GmShape specialization for a Wedge with 6 nodes object.
Definition: gmWedgeShape.h:110
virtual void centroidCartesian(const GmMatrix &X, GmVector &coord) const
Returns the Wedge15 centroid by numeric integration.
Definition: gmWedgeCellGeometryInfo.h:160
#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
GmCellGeometryIntegrationRuleSetDefaultRules< GM_GAUSS_RULE_TYPE, 3, -1, -1, -1 > GmQuadraticWedgeTriFaceIntegrationRuleSetDefaults
For the Wedge15 FACE rules, we define a rule for triangular faces and a rule for quad faces,...
Definition: gmWedgeCellGeometryInfo.h:88
void wedgeCentroid(const GmVector &p1, const GmVector &p2, const GmVector &p3, const GmVector &p4, const GmVector &p5, const GmVector &p6, GmVector &coord)
Returns the cartesian coordinate of the wedge centroid.
Definition: gmGeometryUtils.cpp:383
A helper class used to store the default rules for elements with more than one face type (like wedges...
Definition: gmCellGeometryIntegrationRuleSet.h:117
Gauss integration rule for Wedge element borders (edges)
Definition: gmWedgeIntegrationRule.h:110
3D Gauss integration rules for Wedge elements
Definition: gmWedgeIntegrationRule.h:41
GmCellGeometryIntegrationRuleSetDoubleParDefaultRules< GM_GAUSS_RULE_TYPE, 3, 2, -1, -1, -1, -1, -1, -1 > GmQuadraticWedgeIntegrationRuleSetDefaults
The set of default rules for a Wedge15 ELEMENT. Template parameters 2 to 9 are the default rule numbe...
Definition: gmWedgeCellGeometryInfo.h:83
GmCellGeometryIntegrationRuleSetDoubleParDefaultRules< GM_GAUSS_RULE_TYPE, 1, 2, -1, -1, -1, -1, -1, -1 > GmLinearWedgeIntegrationRuleSetDefaults
The set of default rules for a Wedge6 ELEMENT. Template parameters 2 to 9 are the default rule number...
Definition: gmWedgeCellGeometryInfo.h:59
Declaration of the GmCellGeometryInfo base class.
arma::vec GmVector
The basic type for a GeMA vector object. Currently based on an Armadillo vector.
Definition: gmVector.h:34
GmCellGeometryIntegrationRuleSet< GmWedgeGaussFaceIntegrationRule, GmCellGeometryNullIntegrationRule, GmCellGeometryNullIntegrationRule, GmCellGeometryNullIntegrationRule > GmWedgeFaceIntegrationRuleSet
The set of possible FACE integration rules, per integration rule type, for the family of Wedge elemen...
Definition: gmWedgeCellGeometryInfo.h:45
virtual void centroidCartesian(const GmMatrix &X, GmVector &coord) const
Returns the Wedge6 centroid by decomposing it into 3 tetrahedra and weighting each coordinate by the ...
Definition: gmWedgeCellGeometryInfo.h:123
arma::mat GmMatrix
The basic type for a GeMA matrix object. Currently based on an Armadillo matrix.
Definition: gmMatrix.h:38
virtual bool 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: gmWedgeCellGeometryInfo.h:164
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: gmWedgeCellGeometryInfo.h:114
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: gmWedgeCellGeometryInfo.h:154
Plane structure storing the full set of geometric metadata for a cell type.
Definition: gmCellGeometryInfo.h:57