GemaCoreLib
The GeMA Core library
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
GmLinearMultiTableIntegrationRule< N > Class Template Reference

A helper class used to combine 1, 2 or 3 single "line" integration rule tables into a multi-dimensional integration rule. The combined rule has the same number of natural coordinates as the number of supplied tables. Also, each rule parameter corresponds to a table and rule degree. More...

#include <gmIntegrationRule.h>

Inheritance diagram for GmLinearMultiTableIntegrationRule< N >:
Inheritance graph
[legend]
Collaboration diagram for GmLinearMultiTableIntegrationRule< N >:
Collaboration graph
[legend]

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
 Given an index from 0 to numPoints() - 1, fills naturalCoord and weight with the position and weigth of the given integration point. 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...
 
- Public Member Functions inherited from GmIntegrationRule
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

 GmLinearMultiTableIntegrationRule (GmIntegrationRuleType ruleType, GmIntegrationRuleCacheKeyBase cacheKeyBase, int rule1, const QVector< QPair< double, double >> *table1, int degree1, int rule2=-1, const QVector< QPair< double, double >> *table2=NULL, int degree2=0, int rule3=-1, const QVector< QPair< double, double >> *table3=NULL, int degree3=0)
 Constructor. Receives the rule type + cache key base, along with the set of rule numbers + the table defining the integration rule in that dimension. More...
 
- Protected Member Functions inherited from GmIntegrationRule
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 combined rule degree (the minimum of the individual rule degrees)
 
int _nip
 The number of integration points.
 
int _rules [3]
 The rule numbers. -1 if unused. If a rule is -1, all following rules are also -1.
 
const QVector< QPair< double, double > > * _tables [3]
 Tables with point & weight data for the given rule. NULL if unused. If a table is NULL, all following tables are NULL.
 
GmIntegrationRuleCacheKeyBase _keyBase
 The base cache key.
 

Additional Inherited Members

- Static Public Member Functions inherited from GmIntegrationRule
static GmIntegrationRuleinstance (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...
 

Detailed Description

template<int N>
class GmLinearMultiTableIntegrationRule< N >

A helper class used to combine 1, 2 or 3 single "line" integration rule tables into a multi-dimensional integration rule. The combined rule has the same number of natural coordinates as the number of supplied tables. Also, each rule parameter corresponds to a table and rule degree.

The number of points is equal to the product of the individual table sizes.

The combined rule degree is the minimum of the individual degrees.

The template parameter is the number of tables. It is used so that the integrationPoint() method can be specialized without runtime conditions overhead.

Constructor & Destructor Documentation

◆ GmLinearMultiTableIntegrationRule()

template<int N>
GmLinearMultiTableIntegrationRule< N >::GmLinearMultiTableIntegrationRule ( GmIntegrationRuleType  ruleType,
GmIntegrationRuleCacheKeyBase  cacheKeyBase,
int  rule1,
const QVector< QPair< double, double >> *  table1,
int  degree1,
int  rule2 = -1,
const QVector< QPair< double, double >> *  table2 = NULL,
int  degree2 = 0,
int  rule3 = -1,
const QVector< QPair< double, double >> *  table3 = NULL,
int  degree3 = 0 
)
protected

Constructor. Receives the rule type + cache key base, along with the set of rule numbers + 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()

Member Function Documentation

◆ cacheKey()

template<int N>
virtual int GmLinearMultiTableIntegrationRule< N >::cacheKey ( ) const
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.

◆ integrationPoint()

template<int N>
virtual void GmLinearMultiTableIntegrationRule< N >::integrationPoint ( int  index,
GmVector naturalCoord,
double *  weight 
) const
virtual

Given an index from 0 to numPoints() - 1, fills naturalCoord and weight with the position and weigth of the given integration point.

After filled, naturalCoord will be a vector with size equal to numNaturalCoord(), which should be equal to the number of natural coordinates of the shape function of the element that this rule will be tied to.

Implements GmIntegrationRule.

◆ isValid()

template<int N>
bool GmLinearMultiTableIntegrationRule< N >::isValid ( ) const
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.

◆ ruleParNumPoints()

template<int N>
virtual int GmLinearMultiTableIntegrationRule< N >::ruleParNumPoints ( int  num) const
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.


The documentation for this class was generated from the following files: