dune-fem  2.8-git
dunequadratures.hh
Go to the documentation of this file.
1 #ifndef DUNE_FEM_DUNEQUADRATURES_HH
2 #define DUNE_FEM_DUNEQUADRATURES_HH
3 
4 //- Dune includes
5 #include <dune/geometry/type.hh>
6 #include <dune/geometry/quadraturerules.hh>
7 
9 
10 namespace 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:
44  typedef QuadratureRule< FieldType, dimension > DuneQuadratureRuleType;
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:
64  QuadratureRulesFactory( const GeometryType &geometry,
65  const int order,
66  const size_t id )
67  : BaseType( id ),
68  elementGeometry_( geometry )
69  {
70  // get gauss quadrature
71  const DuneQuadratureRuleType &rule
72  = QuadratureRules< FieldType, dimension >
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 
94  GeometryType geometryType () const
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 >
111  {
114 
116 
117  typedef int QuadratureKeyType ;
118  };
119 
120  template< class FieldType >
121  struct DuneQuadratureTraits< FieldType, 0 >
122  {
124 
126 
127  typedef int QuadratureKeyType ;
128  };
129 
130  template< class FieldType >
131  struct DuneQuadratureTraits< FieldType, 1 >
132  {
134 
136 
137  typedef int QuadratureKeyType ;
138  };
139 
140  template< class FieldType >
141  struct DuneQuadratureTraits< FieldType, 3 >
142  {
145 
148 
150 
151  typedef int QuadratureKeyType ;
152  };
153 
154  } // namespace Fem
155 
156 } // namespace Dune
157 
158 #endif // #ifndef DUNE_FEM_DUNEQUADRATURES_HH
Definition: bindguard.hh:11
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
FieldImp FieldType
Definition: dunequadratures.hh:29
int order_
Definition: dunequadratures.hh:55
QuadratureRulesFactory(const GeometryType &geometry, const int order, const size_t id)
constructor filling the list of points and weights
Definition: dunequadratures.hh:64
@ dimension
Definition: dunequadratures.hh:31
BaseType ::CoordinateType CoordinateType
Definition: dunequadratures.hh:41
@ highest_order
Definition: dunequadratures.hh:49
const GeometryType elementGeometry_
Definition: dunequadratures.hh:54
QuadratureRule< FieldType, dimension > DuneQuadratureRuleType
Definition: dunequadratures.hh:44
static unsigned int maxOrder()
maximal order of available quadratures
Definition: dunequadratures.hh:101
Definition: dunequadratures.hh:111
QuadratureImp< FieldType, dim > IntegrationPointListType
Definition: dunequadratures.hh:115
int QuadratureKeyType
Definition: dunequadratures.hh:117
QuadratureRulesFactory< FieldType, dim > SimplexQuadratureType
Definition: dunequadratures.hh:112
QuadratureRulesFactory< FieldType, dim > CubeQuadratureType
Definition: dunequadratures.hh:113
int QuadratureKeyType
Definition: dunequadratures.hh:127
QuadratureImp< FieldType, 0 > IntegrationPointListType
Definition: dunequadratures.hh:125
QuadratureRulesFactory< FieldType, 0 > PointQuadratureType
Definition: dunequadratures.hh:123
QuadratureImp< FieldType, 1 > IntegrationPointListType
Definition: dunequadratures.hh:135
int QuadratureKeyType
Definition: dunequadratures.hh:137
QuadratureRulesFactory< FieldType, 1 > LineQuadratureType
Definition: dunequadratures.hh:133
QuadratureRulesFactory< FieldType, 3 > CubeQuadratureType
Definition: dunequadratures.hh:144
QuadratureRulesFactory< FieldType, 3 > PrismQuadratureType
Definition: dunequadratures.hh:146
QuadratureRulesFactory< FieldType, 3 > SimplexQuadratureType
Definition: dunequadratures.hh:143
QuadratureRulesFactory< FieldType, 3 > PyramidQuadratureType
Definition: dunequadratures.hh:147
int QuadratureKeyType
Definition: dunequadratures.hh:151
QuadratureImp< FieldType, 3 > IntegrationPointListType
Definition: dunequadratures.hh:149
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