GemaCoreLib
The GeMA Core library
Loading...
Searching...
No Matches
gmGaussIntegrationTables.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
25#ifndef _GEMA_GAUSS_INT_TABLES_H_
26#define _GEMA_GAUSS_INT_TABLES_H_
27
28#include "gmCoreConfig.h"
29#include "gmVector.h"
30
31#include <QVector>
32
37{
38public:
39
44 {
45 if(rule < 1 || rule > 5)
46 return NULL;
47 assert(!_lineTable[rule-1].isEmpty());
48 return &_lineTable[rule-1];
49 }
50
54 static int lineRuleDegree(int rule) { return 2 * rule - 1; }
55
60 {
61 if(rule != 1 && rule != 3 && rule != 6)
62 return NULL;
63 assert(!_triTable[rule-1].isEmpty());
64 return &_triTable[rule-1];
65 }
66
71 static int triRuleDegree(int rule) { return (rule == 1) ? 1 : ((rule == 3) ? 2 : 4); }
72
77 {
78 if(rule != 1 && rule != 4)
79 return NULL;
80 assert(!_tetTable[rule-1].isEmpty());
81 return &_tetTable[rule-1];
82 }
83
88 static int tetRuleDegree(int rule) { return (rule == 1) ? 1 : 2; }
89
94 {
95 if (rule != 1 && rule != 5 && rule != 13)
96 return NULL;
97 assert(!_pyraTable[rule - 1].isEmpty());
98 return &_pyraTable[rule - 1];
99 }
100
105 static int pyraRuleDegree(int rule) { return (rule == 1) ? 1 : 2; }
106
107 static bool initTables();
108
109private:
110 static void initLineTable();
111 static void initTriTable();
112 static void initTetTable();
113 static void initPyraTable();
114
116 static QVector<QPair<double, double>> _lineTable[5];
117
123
129
134 static QVector<QPair<GmVector, double>> _pyraTable[13];
135};
136
137#endif
138
A class storing tables with (position, weight) pairs for line, triangle and tetrahedron Gauss integra...
Definition gmGaussIntegrationTables.h:37
static const QVector< QPair< GmVector, double > > * pyraRuleTable(int rule)
Returns the table storing (position, weight) pairs for the given pyramid Gauss rule....
Definition gmGaussIntegrationTables.h:93
static int lineRuleDegree(int rule)
Returns the integration degree for the given line Gauss rule (The polynomial degree for which this ...
Definition gmGaussIntegrationTables.h:54
static const QVector< QPair< double, double > > * lineRuleTable(int rule)
Returns the table storing (position, weight) pairs for the given line Gauss rule. Rule SHOULD be in t...
Definition gmGaussIntegrationTables.h:43
static int pyraRuleDegree(int rule)
Returns the integration degree for the given pyramid Gauss rule (The polynomial degree for which this...
Definition gmGaussIntegrationTables.h:105
static int triRuleDegree(int rule)
Returns the integration degree for the given triangle Gauss rule (The polynomial degree for which thi...
Definition gmGaussIntegrationTables.h:71
static int tetRuleDegree(int rule)
Returns the integration degree for the given tetrahedron Gauss rule (The polynomial degree for which ...
Definition gmGaussIntegrationTables.h:88
static const QVector< QPair< GmVector, double > > * tetRuleTable(int rule)
Returns the table storing (position, weight) pairs for the given tetrahedron Gauss rule....
Definition gmGaussIntegrationTables.h:76
static const QVector< QPair< GmVector, double > > * triRuleTable(int rule)
Returns the table storing (position, weight) pairs for the given triangle Gauss rule....
Definition gmGaussIntegrationTables.h:59
Declaration of useful configuration definitions for the Core library.
#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 GmVector class.