![]() |
GemaCoreLib
The GeMA Core library
|
A helper class used to implement rules based on a single table storing the full natural coordinate + its weight. It can be used, for example, to implement triangular, tetrahedron and pyramid integration rules. The N template parameter defines the number of natural coordinates returned by the rule. More...
#include <gmIntegrationRule.h>
Public Member Functions | |
bool | isValid () const |
Returns true if this is a valid integration rule object, false if not. More... | |
virtual int | numPoints () const |
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, assuming that the number of coordinates in the positions stored in the rule table are equal to N. More... | |
virtual int | numNaturalCoord () const |
Returns the number of natural coordinates used by this integration rule. | |
virtual int | degree () const |
Returns the integration degree for this rule (The polynomial degree for which this rule is exact) | |
virtual GmIntegrationRuleType | ruleType () const |
Returns the type of the integration rule. | |
virtual QString | ruleName () const |
Returns the current ruleName adopted by this integration rule. | |
virtual int | rulePar (int num) const |
Returns the value of the numbered rule parameter received in the rule constructor (-1 if unused). Num should be a value between 1 and 3. | |
virtual int | ruleParNumPoints (int num) const |
virtual int | cacheKey () const |
Returns an unique integer that can be used to uniquelly represent this kind of integration rule (i.e, two objects with the same cache key should return exactly the same set of integration points). More... | |
![]() | |
virtual | ~GmIntegrationRule () |
Virtual destructor. | |
virtual const QVector< int > & | closestIntegrationIndex (GmCellType type, int P, int Q, int nodeIndex) const |
Returns a list with the index of the closest(s) integraion points from nodeIndex. More... | |
Protected Member Functions | |
GmSingleTableIntegrationRule (GmIntegrationRuleType ruleType, GmIntegrationRuleCacheKeyBase cacheKeyBase, int rule, const QVector< QPair< GmVector, double >> *table, int degree) | |
Constructor. Receives the rule type + cache key base, along with the rule number + the table defining the integration rule in that dimension. More... | |
![]() | |
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. | |
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. | |
Protected Attributes | |
GmIntegrationRuleType | _rtype |
The rule type. | |
int | _degree |
The rule degree. | |
int | _rule |
The rule number. | |
const QVector< QPair< GmVector, double > > * | _table |
The selected rule table or NULL for invalid rules. | |
GmIntegrationRuleCacheKeyBase | _keyBase |
The base cache key. | |
Additional Inherited Members | |
![]() | |
static GmIntegrationRule * | instance (GmCellType type, int P, int Q, GmIntegrationRuleType irType, int rule1=-1, int rule2=-1, int rule3=-1) |
Instanciates an integration rule for the specified element type using the provided parameters. Returns NULL if the parameter set results in an invalid integration rule. More... | |
A helper class used to implement rules based on a single table storing the full natural coordinate + its weight. It can be used, for example, to implement triangular, tetrahedron and pyramid integration rules. The N template parameter defines the number of natural coordinates returned by the rule.
This class is different from a GmLinearMultiTableIntegrationRule with just one table since for that class the number of natural coordinates is always equal to the number of tables.
|
protected |
Constructor. Receives the rule type + cache key base, along with the rule number + the table defining the integration rule in that dimension.
Creates an invalid object for rules outside the valid range (table == NULL). See comments on GmIntegrationRule::isValid()
|
inlinevirtual |
Returns an unique integer that can be used to uniquelly represent this kind of integration rule (i.e, two objects with the same cache key should return exactly the same set of integration points).
The returned value is used together with an element type as a cache key in closestIntegrationIndex() and in GmShape::gaussExtrapolationMatrix().
Implements GmIntegrationRule.
|
virtual |
This function returns weights and points to be sampled for the configured integration rule, assuming that the number of coordinates in the positions stored in the rule table are equal to N.
index | Index (i, from 0 to numPoints()-1) of the point to be sampled |
naturalCoord | Returns the point where the function should be sampled |
weight | Returns the weight of this point |
Implements GmIntegrationRule.
Reimplemented in GmReducedBarycentricSingleTableIntegrationRule< N >, and GmReducedBarycentricSingleTableIntegrationRule< 2 >.
|
inlinevirtual |
Returns true if this is a valid integration rule object, false if not.
An invalid object can be created when an invalid rule number is passed to the constructor of an integration rule. The result of calling a method other then isValid() over an invalid integration rule is undefined.
Implements GmIntegrationRule.
|
inlinevirtual |
Returns the number of integration points associated with the given rule parameter. This is usefull for compound rules to access the number of points in each "dimension". For non compound rules, returns the number of points. Keep in mind that following the rulePar way, it returns -1 for a unknown parameter. In a 2 x 3 quad rule, for example, it should return 2 for parameter 0 and 3 for parameter 1. This method is necessary since for Newton Coates rules for tri/tet elements the number of points is NOT equal to the parameter and when combined in a Wedge this information is necessary.
Implements GmIntegrationRule.