24 #ifndef _GEMA_INT_RULE_H_ 25 #define _GEMA_INT_RULE_H_ 100 virtual bool isValid()
const = 0;
103 virtual int numPoints()
const = 0;
113 virtual void integrationPoint(
int index,
GmVector& naturalCoord,
double* weight)
const = 0;
116 virtual int numNaturalCoord()
const = 0;
119 virtual int degree()
const = 0;
125 virtual QString ruleName()
const = 0;
130 virtual int rulePar(
int num)
const = 0;
140 virtual int ruleParNumPoints(
int num)
const = 0;
149 virtual int cacheKey()
const = 0;
159 assert(rule1 < 100 && rule2 < 100 && rule3 < 100);
160 assert(base >= 10000000);
161 int key = base + (closed * 1000000) + rule1;
162 if(rule2 != -1) key += rule2 * 100;
163 if(rule3 != -1) key += rule3 * 10000;
193 static_assert(N >= 1 && N <= 3,
"Unexpeced number of tables");
217 virtual int rulePar(
int num)
const { assert(num >= 1 && num <= 3);
return _rules[num-1]; }
222 assert(num >= 1 && num <= 3);
223 return _tables[num-1] ? _tables[num-1]->size() : -1;
276 virtual int rulePar(
int num)
const {
return (num == 1) ? _rule : -1; }
virtual QString ruleName() const
Returns the current ruleName adopted by this integration rule.
Definition: gmIntegrationRule.h:214
GmIntegrationRuleType
The type of desired integration rule (Gauss quadrature, Lobatto quadrature, etc)
Definition: gmIntegrationRule.h:67
virtual GmIntegrationRuleType ruleType() const
Returns the type of the integration rule.
Definition: gmIntegrationRule.h:270
Gauss rules.
Definition: gmIntegrationRule.h:75
Base cache key for 3D Newton cotes tetrahedron rules.
Definition: gmIntegrationRule.h:55
Declaration of usefull configuration definitions for the Core library.
const QVector< QPair< GmVector, double > > * _table
The selected rule table or NULL for invalid rules.
Definition: gmIntegrationRule.h:291
virtual int cacheKey() const
Returns an unique integer that can be used to uniquelly represent this kind of integration rule (i....
Definition: gmIntegrationRule.h:282
Declaration of the GmCellType enum.
Nota a rule, the number of rules above.
Definition: gmIntegrationRule.h:83
virtual int rulePar(int num) const
Returns the value of the numbered rule parameter received in the rule constructor (-1 if unused)....
Definition: gmIntegrationRule.h:276
GmIntegrationRuleType _rtype
The rule type.
Definition: gmIntegrationRule.h:288
int _nip
The number of integration points.
Definition: gmIntegrationRule.h:237
virtual QString ruleName() const
Returns the current ruleName adopted by this integration rule.
Definition: gmIntegrationRule.h:273
bool isValid() const
Returns true if this is a valid integration rule object, false if not.
Definition: gmIntegrationRule.h:197
Lobatto rules.
Definition: gmIntegrationRule.h:76
GmIntegrationRuleCacheKeyBase _keyBase
The base cache key.
Definition: gmIntegrationRule.h:292
Base cache key for 3D Gauss tetrahedron rules.
Definition: gmIntegrationRule.h:46
int _degree
The combined rule degree (the minimum of the individual rule degrees)
Definition: gmIntegrationRule.h:236
virtual int numPoints() const
Returns the number of integration points returned by this rule.
Definition: gmIntegrationRule.h:200
GmIntegrationRuleCacheKeyBase
Enumeration used to define global cache keys for integration rules. These values are used by implemen...
Definition: gmIntegrationRule.h:40
Base cache key for 3D Newton triangle interface rules.
Definition: gmIntegrationRule.h:56
Integration rule base classe.
Definition: gmIntegrationRule.h:88
An especialization of the barycentric, single table, integration rule class to treat the case when th...
Definition: gmIntegrationRule.h:304
static QMutex _cipCacheMutex
The mutex protecting _cipCache.
Definition: gmIntegrationRule.h:176
GmIntegrationRuleType _rtype
The rule type.
Definition: gmIntegrationRule.h:235
virtual int ruleParNumPoints(int num) const
Definition: gmIntegrationRule.h:279
virtual int numNaturalCoord() const
Returns the number of natural coordinates used by this integration rule.
Definition: gmIntegrationRule.h:205
Base cache key for 3D Gauss hex rules.
Definition: gmIntegrationRule.h:45
int makeCacheKey(GmIntegrationRuleCacheKeyBase base, bool closed, int rule1, int rule2=-1, int rule3=-1) const
Creates an unique cache key based on the rule type cache key and the rule parameters.
Definition: gmIntegrationRule.h:157
virtual int numPoints() const =0
Returns the number of integration points returned by this rule.
virtual void integrationPoint(int index, GmVector &naturalCoord, double *weight) const
This function returns weights and points to be sampled for the configured integration rule,...
Definition: gmIntegrationRule.cpp:355
virtual bool isValid() const =0
Returns true if this is a valid integration rule object, false if not.
Base cache key for 3D Gauss triangle interface rules.
Definition: gmIntegrationRule.h:49
Base cache key for 3D Newton cotes hex rules.
Definition: gmIntegrationRule.h:54
Base cache key for 2D Gauss quad rules.
Definition: gmIntegrationRule.h:43
virtual int ruleParNumPoints(int num) const
Definition: gmIntegrationRule.h:220
virtual int rulePar(int num) const
Returns the value of the numbered rule parameter received in the rule constructor (-1 if unused)....
Definition: gmIntegrationRule.h:217
Base cache key for 3D Gauss wedge rules.
Definition: gmIntegrationRule.h:47
Base cache key for 2D Newton cotes triangle rules.
Definition: gmIntegrationRule.h:53
virtual int degree() const
Returns the integration degree for this rule (The polynomial degree for which this rule is exact)
Definition: gmIntegrationRule.h:267
Base cache key for 2D Newton cotes quad rules.
Definition: gmIntegrationRule.h:52
QString makeRuleName(GmIntegrationRuleType irType, int rule1, int rule2=-1, int rule3=-1) const
Returns a standard rule name based on rule type and rule parameters.
Definition: gmIntegrationRule.cpp:129
GmIntegrationRuleCacheKeyBase _keyBase
The base cache key.
Definition: gmIntegrationRule.h:240
Declaration of the GmVector class.
Base cache key for user derived classes.
Definition: gmIntegrationRule.h:63
#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
virtual int numPoints() const
Returns the number of integration points returned by this rule.
Definition: gmIntegrationRule.h:259
Base cache key for 2D Gauss triangle rules.
Definition: gmIntegrationRule.h:44
Base cache key for 1D Gauss line rules.
Definition: gmIntegrationRule.h:42
int _rule
The rule number.
Definition: gmIntegrationRule.h:290
The type of rule should be choosed by the default for the target element type.
Definition: gmIntegrationRule.h:84
virtual ~GmIntegrationRule()
Virtual destructor.
Definition: gmIntegrationRule.h:92
GmCellType
Mesh Cell types. Don't change type orders or add types without reading comments below.
Definition: gmCellType.h:30
Base cache key for 2D Lobatto quad rules.
Definition: gmIntegrationRule.h:59
virtual int cacheKey() const
Returns an unique integer that can be used to uniquelly represent this kind of integration rule (i....
Definition: gmIntegrationRule.h:227
Base cache key for 1D Newton cotes line rules.
Definition: gmIntegrationRule.h:51
A helper class used to combine 1, 2 or 3 single "line" integration rule tables into a multi-dimension...
Definition: gmIntegrationRule.h:191
Base cache key for 3D Gauss pyramid rules.
Definition: gmIntegrationRule.h:48
virtual GmIntegrationRuleType ruleType() const
Returns the type of the integration rule.
Definition: gmIntegrationRule.h:211
arma::vec GmVector
The basic type for a GeMA vector object. Currently based on an Armadillo vector.
Definition: gmVector.h:34
Base cache key for 3D Lobatto hex rules.
Definition: gmIntegrationRule.h:60
bool isValid() const
Returns true if this is a valid integration rule object, false if not.
Definition: gmIntegrationRule.h:256
Open Newton-Cotes rules.
Definition: gmIntegrationRule.h:78
A helper class used to implement rules based on a single table storing the full natural coordinate + ...
Definition: gmIntegrationRule.h:252
Closed Newton-Cotes rules.
Definition: gmIntegrationRule.h:77
static QMap< QPair< GmCellType, int >, QVector< QVector< int > > > _cipCache
A global cache, keyed by cell type + cacheKey(), storing the list of closest integration points to a ...
Definition: gmIntegrationRule.h:173
virtual void integrationPoint(int index, GmVector &naturalCoord, double *weight) const =0
Given an index from 0 to numPoints() - 1, fills naturalCoord and weight with the position and weigth ...
int _degree
The rule degree.
Definition: gmIntegrationRule.h:289
virtual int degree() const
Returns the integration degree for this rule (The polynomial degree for which this rule is exact)
Definition: gmIntegrationRule.h:208
virtual int numNaturalCoord() const
Returns the number of natural coordinates used by this integration rule.
Definition: gmIntegrationRule.h:264
Base cache key for 1D Lobatto line rules.
Definition: gmIntegrationRule.h:58