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
10namespace Dune
11{
12
13 namespace Fem
14 {
15
24 template< typename FieldImp, int dim >
26 : public QuadratureImp< FieldImp, dim >
27 {
28 public:
29 typedef FieldImp FieldType;
30
31 enum { dimension = dim };
32
33 private:
36
37 protected:
39
40 public:
42
43 protected:
45
46 //enum { highest_order_cube = CubeQuadratureRule<ct,dim>::highest_order };
47 //enum { highest_order_simplex = SimplexQuadratureRule<ct,dim>::highest_order };
48
49 enum { highest_order = 44 };
50 //(highest_order_cube < highest_order_simplex) ?
51 // highest_order_cube : highest_order_simplex };
52
53 protected:
54 const GeometryType elementGeometry_;
55 int order_;
56
57 public:
65 const int order,
66 const size_t id )
67 : BaseType( id ),
68 elementGeometry_( geometry )
69 {
70 // get gauss quadrature
71 const DuneQuadratureRuleType &rule
73 //:: rule( geometry, order, QuadratureType :: GaussLegendre );
74 :: rule( geometry, order, QuadratureType :: GaussLobatto );
75
76 order_ = rule.order();
77 assert( order <= order_ );
78
79 typedef typename DuneQuadratureRuleType :: iterator IteratorType;
80 const IteratorType endit = rule.end();
81 for( IteratorType it = rule.begin(); it != endit; ++it )
82 addQuadraturePoint( (*it).position(), (*it).weight() );
83 }
84
87 int order () const
88 {
89 return order_;
90 }
91
95 {
96 return elementGeometry_;
97 }
98
101 static unsigned int maxOrder ()
102 {
103 return highest_order;
104 }
105 };
106
107
108
109 template< class FieldType, int dim >
110 struct DuneQuadratureTraits
111 {
112 typedef QuadratureRulesFactory< FieldType, dim > SimplexQuadratureType;
113 typedef QuadratureRulesFactory< FieldType, dim > CubeQuadratureType;
114
115 typedef QuadratureImp< FieldType, dim > IntegrationPointListType;
116
117 typedef int QuadratureKeyType ;
118 };
119
120 template< class FieldType >
121 struct DuneQuadratureTraits< FieldType, 0 >
122 {
123 typedef QuadratureRulesFactory< FieldType, 0 > PointQuadratureType;
124
125 typedef QuadratureImp< FieldType, 0 > IntegrationPointListType;
126
127 typedef int QuadratureKeyType ;
128 };
129
130 template< class FieldType >
131 struct DuneQuadratureTraits< FieldType, 1 >
132 {
133 typedef QuadratureRulesFactory< FieldType, 1 > LineQuadratureType;
134
135 typedef QuadratureImp< FieldType, 1 > IntegrationPointListType;
136
137 typedef int QuadratureKeyType ;
138 };
139
140 template< class FieldType >
141 struct DuneQuadratureTraits< FieldType, 3 >
142 {
143 typedef QuadratureRulesFactory< FieldType, 3 > SimplexQuadratureType;
144 typedef QuadratureRulesFactory< FieldType, 3 > CubeQuadratureType;
145
146 typedef QuadratureRulesFactory< FieldType, 3 > PrismQuadratureType;
147 typedef QuadratureRulesFactory< FieldType, 3 > PyramidQuadratureType;
148
149 typedef QuadratureImp< FieldType, 3 > IntegrationPointListType;
150
151 typedef int QuadratureKeyType ;
152 };
153
154 } // namespace Fem
155
156} // namespace Dune
157
158#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:27
int order() const
obtain order of the integration point list
Definition: dunequadratures.hh:87
GeometryType geometryType() const
Definition: dunequadratures.hh:94
QuadratureRulesFactory(const GeometryType &geometry, const int order, const size_t id)
constructor filling the list of points and weights
Definition: dunequadratures.hh:64
static unsigned int maxOrder()
maximal order of available quadratures
Definition: dunequadratures.hh:101
vector space out of a tensor product of fields.
Definition: fvector.hh:91
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  |  generated with Hugo v0.111.3 (Nov 21, 23:30, 2024)