DUNE-FEM (unstable)

dunequadratures.hh
1#ifndef DUNE_FEM_DUNEQUADRATURES_HH
2#define DUNE_FEM_DUNEQUADRATURES_HH
3
4//- Dune includes
7
8#include <dune/fem/quadrature/quadratureimp.hh>
9#include <dune/fem/quadrature/femquadratures.hh>
10
11namespace Dune
12{
13
14 namespace Fem
15 {
16
17
18
27 template< typename FieldImp, int dim >
29 : public QuadratureImp< FieldImp, dim >
30 {
31 public:
32 typedef FieldImp FieldType;
33
34 enum { dimension = dim };
35
36 private:
39
40 protected:
42
43 public:
45
46 protected:
48
49 //enum { highest_order_cube = CubeQuadratureRule<ct,dim>::highest_order };
50 //enum { highest_order_simplex = SimplexQuadratureRule<ct,dim>::highest_order };
51
52 enum { highest_order = 44 };
53 //(highest_order_cube < highest_order_simplex) ?
54 // highest_order_cube : highest_order_simplex };
55
56 protected:
57 const GeometryType elementGeometry_;
58 int order_;
59
60 public:
68 const int order,
69 const size_t id )
70 : BaseType( id ),
71 elementGeometry_( geometry )
72 {
73 // get gauss quadrature
74 const DuneQuadratureRuleType &rule
76 //:: rule( geometry, order, QuadratureType :: GaussLegendre );
77 :: rule( geometry, order, QuadratureType :: GaussLobatto );
78
79 order_ = rule.order();
80 assert( order <= order_ );
81
82 typedef typename DuneQuadratureRuleType :: iterator IteratorType;
83 const IteratorType endit = rule.end();
84 for( IteratorType it = rule.begin(); it != endit; ++it )
85 addQuadraturePoint( (*it).position(), (*it).weight() );
86 }
87
90 int order () const
91 {
92 return order_;
93 }
94
98 {
99 return elementGeometry_;
100 }
101
104 static unsigned int maxOrder ()
105 {
106 return highest_order;
107 }
108 };
109
110
111
112 template< class FieldType, int dim >
113 struct DuneQuadratureTraits
114 {
115 typedef QuadratureRulesFactory< FieldType, dim > SimplexQuadratureType;
116 typedef QuadratureRulesFactory< FieldType, dim > CubeQuadratureType;
117 typedef PolyhedronQuadrature< FieldType, dim > PolyhedronQuadratureType;
118
119 typedef QuadratureImp< FieldType, dim > IntegrationPointListType;
120
121 typedef int QuadratureKeyType ;
122 };
123
124 template< class FieldType >
125 struct DuneQuadratureTraits< FieldType, 0 >
126 {
127 typedef QuadratureRulesFactory< FieldType, 0 > PointQuadratureType;
128
129 typedef QuadratureImp< FieldType, 0 > IntegrationPointListType;
130
131 typedef int QuadratureKeyType ;
132 };
133
134 template< class FieldType >
135 struct DuneQuadratureTraits< FieldType, 1 >
136 {
137 typedef QuadratureRulesFactory< FieldType, 1 > LineQuadratureType;
138
139 typedef QuadratureImp< FieldType, 1 > IntegrationPointListType;
140
141 typedef int QuadratureKeyType ;
142 };
143
144 template< class FieldType >
145 struct DuneQuadratureTraits< FieldType, 3 >
146 {
147 typedef QuadratureRulesFactory< FieldType, 3 > SimplexQuadratureType;
148 typedef QuadratureRulesFactory< FieldType, 3 > CubeQuadratureType;
149
150 typedef QuadratureRulesFactory< FieldType, 3 > PrismQuadratureType;
151 typedef QuadratureRulesFactory< FieldType, 3 > PyramidQuadratureType;
152
153 typedef PolyhedronQuadrature< FieldType, 3 > PolyhedronQuadratureType;
154
155 typedef QuadratureImp< FieldType, 3 > IntegrationPointListType;
156
157 typedef int QuadratureKeyType ;
158 };
159
160 } // namespace Fem
161
162} // namespace Dune
163
164#endif // #ifndef DUNE_FEM_DUNEQUADRATURES_HH
size_t id() const
obtain the identifier of the integration point list
Definition: quadratureimp.hh:122
Generic implementation of a Dune quadrature.
Definition: quadratureimp.hh:196
void addQuadraturePoint(const CoordinateType &point, const FieldType weight)
Adds a point-weight pair to the quadrature.
Definition: quadratureimp.hh:270
BaseType::CoordinateType CoordinateType
type of local coordinates
Definition: quadratureimp.hh:207
quadrature implementation based on the standard DUNE quadratures
Definition: dunequadratures.hh:30
int order() const
obtain order of the integration point list
Definition: dunequadratures.hh:90
GeometryType geometryType() const
Definition: dunequadratures.hh:97
QuadratureRulesFactory(const GeometryType &geometry, const int order, const size_t id)
constructor filling the list of points and weights
Definition: dunequadratures.hh:67
static unsigned int maxOrder()
maximal order of available quadratures
Definition: dunequadratures.hh:104
vector space out of a tensor product of fields.
Definition: fvector.hh:92
Unique label for each type of entities that can occur in DUNE grids.
Definition: type.hh:114
Abstract base class for quadrature rules.
Definition: quadraturerules.hh:214
virtual int order() const
return order
Definition: quadraturerules.hh:237
std::vector< QuadraturePoint< ct, dim > >::const_iterator iterator
Definition: quadraturerules.hh:245
A container for all quadrature rules of dimension dim
Definition: quadraturerules.hh:260
@ GaussLobatto
Gauss-Lobatto rules.
Definition: quadraturerules.hh:176
Dune namespace.
Definition: alignedallocator.hh:13
A unique label for each type of element that can occur in a grid.
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden & Uni Heidelberg  |  generated with Hugo v0.111.3 (Apr 22, 22:34, 2025)