dune-fem 2.12-git
Loading...
Searching...
No Matches
gausspoints.hh
Go to the documentation of this file.
1#ifndef DUNE_FEM_GAUSSPOINTS_HH
2#define DUNE_FEM_GAUSSPOINTS_HH
3
4#include <cassert>
5#include <vector>
6
8
9namespace Dune
10{
11
12 namespace Fem
13 {
14
26 {
27 protected:
28 std::vector< std::vector< double > > G; //[MAXP+1][MAXP]; // positions of Gauss points
29 std::vector< std::vector< double > > W; //[MAXP+1][MAXP]; // weights associated with points
30 std::vector< int > O; //[MAXP+1]; // order of the rule
31
34 QuadPtsBase ( const int maxp )
35 : G( maxp+1, std::vector<double>(maxp,0.0)),
36 W( maxp+1, std::vector<double>(maxp,0.0)),
37 O( maxp+1, 0 )
38 {}
39
40 public:
48 double point ( int m, int i ) const
49 {
50 assert(m > 0 && i < m);
51 return G[m][i];
52 }
53
61 double weight ( int m, int i ) const
62 {
63 assert(m > 0 && i < m);
64 return W[m][i];
65 }
66
73 int order ( int m ) const
74 {
75 return O[m];
76 }
77
87 int power ( int y, int d ) const
88 {
89 int m = 1;
90 for( int i = 0; i < d; ++i )
91 m *= y;
92 return m;
93 }
94 };
95
96
107 class GaussPts : public QuadPtsBase
108 {
109 public:
111 static const int MAXP=10;
112
114 static const int highestOrder=19;
115
116 protected:
117 using QuadPtsBase :: G;
118 using QuadPtsBase :: W;
119 using QuadPtsBase :: O;
120
121 public:
124 GaussPts ();
125 };
126
142 {
143 public:
145 static const int MAXP=10;
146
148 static const int highestOrder=10;
149
150 protected:
151 using QuadPtsBase :: G;
152 using QuadPtsBase :: W;
153 using QuadPtsBase :: O;
154
155 public:
159 };
160 } // namespace Fem
161
162} // namespace Dune
163
166#endif // #ifndef DUNE_FEM_GAUSSPOINTS_HH
STL namespace.
one-dimensional quadrature points and their weights
Definition gausspoints.hh:26
std::vector< std::vector< double > > G
Definition gausspoints.hh:28
int power(int y, int d) const
a simple power method
Definition gausspoints.hh:87
QuadPtsBase(const int maxp)
constructor initializing the points for all orders
Definition gausspoints.hh:34
std::vector< std::vector< double > > W
Definition gausspoints.hh:29
double point(int m, int i) const
obtain the i-th point of the m-th quadrature
Definition gausspoints.hh:48
double weight(int m, int i) const
obtain the i-th weight of the m-th quadrature
Definition gausspoints.hh:61
std::vector< int > O
Definition gausspoints.hh:30
int order(int m) const
obtain the order of the m-th quadrature
Definition gausspoints.hh:73
one-dimensional Gauss points and their weights
Definition gausspoints.hh:108
static const int highestOrder
highest quadrature order within the array
Definition gausspoints.hh:114
static const int MAXP
number of available quadratures
Definition gausspoints.hh:111
GaussPts()
constructor initializing the Gauss points for all orders
Definition gausspoints_implementation.hh:12
Definition gausspoints.hh:142
static const int highestOrder
highest quadrature order within the array
Definition gausspoints.hh:148
ModifiedNewtonCotes()
constructor initializing the points for all orders
Definition modifiednewtoncotes_implementation.hh:12
static const int MAXP
number of available quadratures
Definition gausspoints.hh:145