GemaCoreLib
The GeMA Core library
Loading...
Searching...
No Matches
gmBorderIntegrationRule.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_BORDER_INT_RULE_H_
25#define _GEMA_BORDER_INT_RULE_H_
26
27#include "gmIntegrationRule.h"
28
29class GmShape;
30
31
38{
39public:
61 virtual bool translatePoint(int border, const GmVector& borderCoord, GmVector& elementCoord) const = 0;
62
64 virtual int numBorderCoord() const = 0;
65
66 static GmBorderIntegrationRule* faceInstance(GmCellType type, int P, int Q, int faceType, GmIntegrationRuleType irType, int rule1 = -1, int rule2 = -1);
67 static GmBorderIntegrationRule* edgeInstance(GmCellType type, int P, int Q, GmIntegrationRuleType irType, int rule1 = -1);
68};
69
70
75{
76public:
78
79 // See comments on the base class
80 bool isValid() const { return _rule->isValid(); }
81
82 // See comments on the base class
83 virtual int numPoints() const { return _rule->numPoints(); }
84
85 // See comments on the base class
86 virtual void integrationPoint(int index, GmVector& naturalCoord, double* weight) const
87 {
88 _rule->integrationPoint(index, naturalCoord, weight);
89 }
90
91 // See comments on the base class
92 virtual int numNaturalCoord() const { assert(_rule->isValid()); return _nnatural; }
93
94 // See comments on the base class
95 virtual int degree() const { return _rule->degree(); }
96
97 // See comments on the base class
98 virtual GmIntegrationRuleType ruleType() const { return _rule->ruleType(); }
99
100 // See comments on the base class
101 virtual QString ruleName() const { return _rule->ruleName(); }
102
103 // See comments on the base class
104 virtual int rulePar(int num) const { return _rule->rulePar(num); }
105
106 // See comments on the base class
107 virtual int ruleParNumPoints(int num) const { return _rule->ruleParNumPoints(num); }
108
109 // See comments on the base class
110 virtual int cacheKey() const { return _rule->cacheKey(); }
111
112 // See comments on the base class
113 virtual int numBorderCoord() const { return _rule->numNaturalCoord(); }
114
115 virtual bool translatePoint(int border, const GmVector& borderCoord, GmVector& elementCoord) const;
116
117protected:
118 GmProxyBorderIntegrationRule(GmCellType type, int nnatural, GmIntegrationRule* ir, bool face);
119
123 bool _face;
124};
125
126#endif
127
Border integration rule base classe.
Definition gmBorderIntegrationRule.h:38
virtual bool translatePoint(int border, const GmVector &borderCoord, GmVector &elementCoord) const =0
Given an integration point calculated with the border rule, by a call to integrationPoint(),...
virtual int numBorderCoord() const =0
Returns the number of expected coordinates in a border coordinate.
Integration rule base classe.
Definition gmIntegrationRule.h:89
Common code for border integration rules based on a given integration rule that is used to implement ...
Definition gmBorderIntegrationRule.h:75
virtual int degree() const
Returns the integration degree for this rule (The polynomial degree for which this rule is exact)
Definition gmBorderIntegrationRule.h:95
bool _face
Is this a face or an edge border integration rule?
Definition gmBorderIntegrationRule.h:123
bool isValid() const
Returns true if this is a valid integration rule object, false if not.
Definition gmBorderIntegrationRule.h:80
const GmShape * _shape
The shape function of the element type associated with this rule.
Definition gmBorderIntegrationRule.h:121
virtual int rulePar(int num) const
Returns the value of the numbered rule parameter received in the rule constructor (-1 if unused)....
Definition gmBorderIntegrationRule.h:104
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 ...
Definition gmBorderIntegrationRule.h:86
GmIntegrationRule * _rule
The basic wrapped integration rule.
Definition gmBorderIntegrationRule.h:120
virtual int cacheKey() const
Returns an unique integer that can be used to uniquelly represent this kind of integration rule (i....
Definition gmBorderIntegrationRule.h:110
virtual QString ruleName() const
Returns the current ruleName adopted by this integration rule.
Definition gmBorderIntegrationRule.h:101
virtual int numNaturalCoord() const
Returns the number of natural coordinates used by this integration rule.
Definition gmBorderIntegrationRule.h:92
virtual int numBorderCoord() const
Returns the number of expected coordinates in a border coordinate.
Definition gmBorderIntegrationRule.h:113
virtual GmIntegrationRuleType ruleType() const
Returns the type of the integration rule.
Definition gmBorderIntegrationRule.h:98
int _nnatural
The number of natural coordinates for the rule. Might be different from _shape->numNaturalCoord() for...
Definition gmBorderIntegrationRule.h:122
virtual int numPoints() const
Returns the number of integration points returned by this rule.
Definition gmBorderIntegrationRule.h:83
virtual int ruleParNumPoints(int num) const
Definition gmBorderIntegrationRule.h:107
Shape function handling base classe.
Definition gmShape.h:38
GmCellType
Mesh Cell types. Don't change type orders or add types without reading comments below.
Definition gmCellType.h:31
#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
Declaration of the GmIntegrationRule class and its helper decendants.
GmIntegrationRuleType
The type of desired integration rule (Gauss quadrature, Lobatto quadrature, etc)
Definition gmIntegrationRule.h:68
arma::vec GmVector
The basic type for a GeMA vector object. Currently based on an Armadillo vector.
Definition gmVector.h:34