GemaCoreLib
The GeMA Core library
Loading...
Searching...
No Matches
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
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{
110public:
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 virtual bool localAxis(const GmMatrix&X, GmMatrix& R) const {Q_UNUSED(X); R = arma::eye(3,3); return false;}
129
130 // --------- Capabilities API ---------
131 virtual int isValid(const GmMatrix& X, double tol) const {
132 int ret = GM_GEOMETRY_STATE_VALID;
133 if (!GmGeometryUtils::wedge6HasPlanarFaces(X, tol)) ret |= GM_GEOMETRY_STATE_NON_PLANAR;
134 if (!GmGeometryUtils::wedge6IsWellDefined(X)) ret |= GM_GEOMETRY_STATE_BAD_ORIENTATION;
135 return ret;
136 }
137private:
143};
144
145//---------------------------------------------------------
146// GmWedge15CellGeometryInfo
147//---------------------------------------------------------
148
151 : public GmCellGeometryInfoSolidElement<GmWedgeIntegrationRuleSet, GmQuadraticWedgeIntegrationRuleSetDefaults,
152 GmWedgeEdgeIntegrationRuleSet, GmQuadraticWedgeEdgeIntegrationRuleSetDefaults,
153 GmWedgeFaceIntegrationRuleSet, GmQuadraticWedgeFaceIntegrationRuleSetDefaults>
154{
155public:
156 static const GmWedge15CellGeometryInfo* instance();
157
158 // Shape factory. See comments on the base class.
159 virtual GmShape* shapeInstance(int P, int Q) const { Q_UNUSED(P); Q_UNUSED(Q); return new GmWedge15Shape; }
160
162 virtual double dimension(const GmMatrix& X) const { return dimensionByIntegration(X); }
163
165 virtual void centroidCartesian(const GmMatrix& X, GmVector& coord) const { centroidByIntegration(X, coord); }
166
167 virtual bool localAxis(const GmMatrix&X, GmMatrix& R) const {Q_UNUSED(X); R = arma::eye(3,3); return false;}
168
169 // --------- Capabilities API ---------
170
171 virtual int isValid(const GmMatrix& X, double tol) const {
172 Q_UNUSED(tol);
173 int ret = GM_GEOMETRY_STATE_VALID;
174 if (!GmGeometryUtils::wedge15ValidEdges(X)) ret |= GM_GEOMETRY_STATE_BAD_EDGE;
175 if (!GmGeometryUtils::wedge6IsWellDefined(X)) ret |= GM_GEOMETRY_STATE_BAD_ORIENTATION;
176 return ret;
177 }
178private:
184};
185
186
187#endif
188
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 solid elements. Implements the needed integration rul...
Definition gmCellGeometryInfo.h:440
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 default rules for elements where the default is expressed by two val...
Definition gmCellGeometryIntegrationRuleSet.h:143
A helper class used to store the class types for each rule type. Template parameters are the implemen...
Definition gmCellGeometryIntegrationRuleSet.h:197
A helper class used to store the default rules for elements with more than one face type (like wedges...
Definition gmCellGeometryIntegrationRuleSet.h:118
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 Wedge15 implementation.
Definition gmWedgeCellGeometryInfo.h:154
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 gmWedgeCellGeometryInfo.h:171
GmWedge15CellGeometryInfo(GmCellGeometryMetadata &&metadata)
Protected constructor. Only a single Wedge15 geometry info object is ever necessary,...
Definition gmWedgeCellGeometryInfo.h:180
virtual void centroidCartesian(const GmMatrix &X, GmVector &coord) const
Returns the Wedge15 centroid by numeric integration.
Definition gmWedgeCellGeometryInfo.h:165
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:159
virtual 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 gmWedgeCellGeometryInfo.h:167
virtual double dimension(const GmMatrix &X) const
Returns the Wedge15 volume by numeric integration.
Definition gmWedgeCellGeometryInfo.h:162
GmShape specialization for a Wedge with 6 nodes object.
Definition gmWedgeShape.h:138
The Wedge6 implementation.
Definition gmWedgeCellGeometryInfo.h:109
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
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 gmWedgeCellGeometryInfo.h:131
virtual double dimension(const GmMatrix &X) const
Returns the Wedge6 volume.
Definition gmWedgeCellGeometryInfo.h:117
GmWedge6CellGeometryInfo(GmCellGeometryMetadata &&metadata)
Protected constructor. Only a single Wedge6 geometry info object is ever necessary,...
Definition gmWedgeCellGeometryInfo.h:139
virtual 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 gmWedgeCellGeometryInfo.h:128
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
GmShape specialization for a Wedge with 6 nodes object.
Definition gmWedgeShape.h:114
Gauss integration rule for Wedge element borders (edges)
Definition gmWedgeIntegrationRule.h:111
Gauss integration rule for Wedge element faces.
Definition gmWedgeIntegrationRule.h:96
3D Gauss integration rules for Wedge elements
Definition gmWedgeIntegrationRule.h:42
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
arma::vec GmVector
The basic type for a GeMA vector object. Currently based on an Armadillo vector.
Definition gmVector.h:34
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
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
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
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
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
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
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
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
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
Declaration of the GmWedgeGaussIntegrationRule class, including border rules. Content previously in g...
Declaration of the 3D wedge shapes inheriting from GmShape class Previosuly part of the gmShape3D....
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:228
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:352
Plane structure storing the full set of geometric metadata for a cell type.
Definition gmCellGeometryInfo.h:69