dune-fem  2.4.1-rc
femquadratures.hh
Go to the documentation of this file.
1 #ifndef DUNE_FEM_FEMQUADRATURES_HH
2 #define DUNE_FEM_FEMQUADRATURES_HH
3 
4 #include <dune/geometry/type.hh>
5 #include <dune/geometry/genericgeometry/topologytypes.hh>
6 
8 
9 // quadrature storage classes
10 #include "gausspoints.hh"
11 #include "pyramidpoints.hh"
12 #include "simplexpoints.hh"
13 
14 namespace Dune
15 {
16 
17  namespace Fem
18  {
19 
21  {
22  // uses implementation from parDG
23  enum { maxOrder1 = 39, maxOrder2 = 13, maxOrder3 = 12 };
24 
25  static int maxOrder( const int dim )
26  {
27  if( dim == 1 )
28  return maxOrder1 ;
29  else if( dim == 2 )
30  return maxOrder2 ;
31  else if( dim == 3 )
32  return maxOrder3 ;
33  else
34  {
35  DUNE_THROW(NotImplemented,"SimplexMaxOrder::maxOrder: wrong dimension");
36  return -1;
37  }
38  }
39 
40  };
41 
42  /* \class SimplexQuadrature
43  * \ingroup Quadrature
44  * \brief generic quadrature class for simplices
45  *
46  * SimplexQuadrature implements the geometry-specific part of the quadrature
47  * and initialises the vector quadrature points and weights.
48  *
49  * \note The UG quadrature rules are used here.
50  */
51  template< class FieldImp, int dim >
53  : public QuadratureImp< FieldImp, dim >
54  {
55  public:
56  typedef FieldImp FieldType;
57 
58  private:
61 
62  public:
65 
66  protected:
67  int order_;
68 
69  static const unsigned int topologyId = GenericGeometry::SimplexTopology< dim >::type::id ;
70 
71  public:
78  SimplexQuadrature( const GeometryType& geometry, int order, size_t id );
79 
82  virtual GeometryType geometryType () const
83  {
84  return GeometryType( topologyId, dim );
85  }
86 
89  virtual int order () const
90  {
91  return order_;
92  }
93 
95  static size_t maxOrder ()
96  {
97  if( dim == 1 )
99  if( dim == 2 )
101  if( dim == 3 )
103  DUNE_THROW( NotImplemented, "SimplexQuadratures from dim > 3 not implemented." );
104  }
105  };
106 
107 
108 
109  /* \class CubeQuadrature
110  * \ingroup Quadrature
111  * \brief generic quadrature class for cubes
112  *
113  * CubeQuadrature implements the geometry-specific part of the quadrature
114  * and initialises the vector quadrature points and weights.
115  *
116  * \note The quadrature uses the 1d gauss points (and their tensorial
117  * product) as quadrature points
118  */
119  template< class FieldImp, int dim >
121  : public QuadratureImp< FieldImp, dim >
122  {
123  public:
124  typedef FieldImp FieldType;
125 
126  private:
129 
130  public:
133 
134  protected:
135  int order_;
136 
137  static const unsigned int topologyId = GenericGeometry::CubeTopology< dim >::type::id ;
138 
139  public:
146  CubeQuadrature( const GeometryType &geometry, int order, size_t id );
147 
149  virtual GeometryType geometryType () const
150  {
151  return GeometryType( topologyId, dim );
152  }
153 
155  virtual int order () const
156  {
157  return order_;
158  }
159 
161  static size_t maxOrder ()
162  {
164  }
165  };
166 
167 
168 
169  /* \class LineQuadrature
170  * \ingroup Quadrature
171  * \brief quadrature class for lines
172  *
173  * LineQuadrature implements the geometry-specific part of the quadrature
174  * and initialises the vector quadrature points and weights.
175  *
176  * \note This class is redundant as CubeQuadrature can be used instead
177  */
178  template< class FieldImp >
180  : public QuadratureImp< FieldImp, 1 >
181  {
182  public:
183  typedef FieldImp FieldType;
184 
185  private:
188 
189  public:
192 
193  protected:
194  int order_;
195 
196  static const unsigned int topologyId = GenericGeometry::CubeTopology< 1 >::type::id ;
197 
198  public:
205  LineQuadrature( const GeometryType &geometry, int order, size_t id );
206 
208  virtual GeometryType geometryType () const
209  {
210  return GeometryType( topologyId, 1 );
211  }
212 
214  virtual int order() const
215  {
216  return order_;
217  }
218 
220  static size_t maxOrder ()
221  {
222  return GaussPts::highestOrder;
223  }
224  };
225 
226 
227 
228  /* \class TriangleQuadrature
229  * \ingroup Quadrature
230  * \brief quadrature class for triangles
231  *
232  * TriangleQuadrature implements the geometry-specific part of the quadrature
233  * and initialises the vector quadrature points and weights.
234  *
235  * \note The UG quadrature rules are used here.
236  *
237  * \note This class is redundant as SimplexQuadrature can be used instead.
238  */
239  template< class FieldImp >
241  : public QuadratureImp< FieldImp, 2 >
242  {
243  public:
244  typedef FieldImp FieldType;
245 
246  private:
249 
250  public:
253 
254  private:
255  int order_;
256 
257  static const unsigned int topologyId = GenericGeometry::SimplexTopology< 2 >::type::id ;
258 
259  public:
266  TriangleQuadrature ( const GeometryType &geometry, int order, size_t id );
267 
269  virtual GeometryType geometryType () const
270  {
271  return GeometryType( topologyId, 2 );
272  }
273 
275  virtual int order () const
276  {
277  return order_;
278  }
279 
281  static size_t maxOrder ()
282  {
284  }
285  };
286 
287 
288 
289  /* \class QuadrilateralQuadrature
290  * \ingroup Quadrature
291  * \brief quadrature class for quadrilaterals
292  *
293  * QuadrilateralQuadrature implements the geometry-specific part of the
294  * quadrature and initialises the vector quadrature points and weights.
295  *
296  * \note The quadrature uses tensorial products of the 1d gauss points
297  * as quadrature points.
298  *
299  * \note This class is redundant as CubeQuadrature can be used instead.
300  */
301  template< class FieldImp >
303  : public QuadratureImp< FieldImp, 2 >
304  {
305  public:
306  typedef FieldImp FieldType;
307 
308  private:
311 
312  public:
315 
316  private:
317  int order_;
318 
319  static const unsigned int topologyId = GenericGeometry::CubeTopology< 2 >::type::id ;
320 
321  public:
328  QuadrilateralQuadrature( const GeometryType &geometry, int order, size_t id );
329 
331  virtual GeometryType geometryType () const
332  {
333  return GeometryType( topologyId, 2 );
334  }
335 
337  virtual int order () const
338  {
339  return order_;
340  }
341 
343  static size_t maxOrder ()
344  {
346  }
347  };
348 
349 
350 
351  /* \class TetraQuadrature
352  * \ingroup Quadrature
353  * \brief quadrature class for tetrahedra
354  *
355  * TetraQuadrature implements the geometry-specific part of the quadrature
356  * and initialises the vector quadrature points and weights.
357  *
358  * \note The UG quadrature rules are used here.
359  *
360  * \note This class is redundant as SimplexQuadrature can be used instead.
361  */
362  template< class FieldImp >
364  : public QuadratureImp< FieldImp, 3 >
365  {
366  public:
367  typedef FieldImp FieldType;
368 
369  private:
372 
373  public:
376 
377  private:
378  int order_;
379 
380  static const unsigned int topologyId = GenericGeometry::SimplexTopology< 3 >::type::id ;
381 
382  public:
389  TetraQuadrature( const GeometryType &geometry, int order, size_t id );
390 
392  virtual GeometryType geometryType () const
393  {
394  return GeometryType( topologyId, 3 );
395  }
396 
398  virtual int order () const
399  {
400  return order_;
401  }
402 
404  static size_t maxOrder ()
405  {
407  }
408  };
409 
410 
411 
412  /* \class HexaQuadrature
413  * \ingroup Quadrature
414  * \brief quadrature class for hexahedra
415  *
416  * HexaQuadrature implements the geometry-specific part of the quadrature
417  * and initialises the vector quadrature points and weights.
418  *
419  * \note The quadrature uses tensorial products of the 1d gauss points
420  * as quadrature points.
421  *
422  * \note This class is redundant as CubeQuadrature can be used instead.
423  */
424  template< class FieldImp >
426  : public QuadratureImp< FieldImp, 3 >
427  {
428  public:
429  typedef FieldImp FieldType;
430 
431  private:
434 
435  public:
438 
439  private:
440  int order_;
441 
442  static const unsigned int topologyId = GenericGeometry::CubeTopology< 3 >::type::id ;
443 
444  public:
451  HexaQuadrature( const GeometryType &geometry, int order, size_t id );
452 
454  virtual GeometryType geometryType () const
455  {
456  return GeometryType( topologyId, 3 );
457  }
458 
460  virtual int order () const
461  {
462  return order_;
463  }
464 
466  static size_t maxOrder()
467  {
468  return GaussPts::highestOrder;
469  }
470  };
471 
472 
473 
474  /* \class PrismQuadrature
475  * \ingroup Quadrature
476  * \brief quadrature class for prisms
477  *
478  * PrismQuadrature implements the geometry-specific part of the quadrature
479  * and initialises the vector quadrature points and weights.
480  *
481  * \note The HD stuff is used here, but needs some rework since only one
482  * rule is provided.
483  */
484  template< class FieldImp >
486  : public QuadratureImp< FieldImp, 3 >
487  {
488  public:
489  typedef FieldImp FieldType;
490 
491  private:
494 
495  public:
498 
499  private:
500  int order_;
501 
502  static const unsigned int topologyId = GenericGeometry::PrismTopology< 3 >::type::id ;
503 
504  public:
511  PrismQuadrature( const GeometryType &geometry, int order, size_t id );
512 
514  virtual GeometryType geometryType () const
515  {
516  return GeometryType( topologyId, 3 );
517  }
518 
520  virtual int order () const
521  {
522  return order_;
523  }
524 
526  static size_t maxOrder ()
527  {
529  }
530  };
531 
532 
533 
534  /* \class PyramidQuadrature
535  * \ingroup Quadrature
536  * \brief quadrature class for pyramids
537  *
538  * PyramidQuadrature implements the geometry-specific part of the quadrature
539  * and initialises the vector quadrature points and weights.
540  *
541  * \note The HD stuff is used here, but needs some rework since only one
542  * rule is provided.
543  */
544  template< class FieldImp >
546  : public QuadratureImp< FieldImp, 3 >
547  {
548  public:
549  typedef FieldImp FieldType;
550 
551  private:
554 
555  public:
558 
559  private:
560  int order_;
561 
562  static const unsigned int topologyId = GenericGeometry::PyramidTopology< 3 >::type::id ;
563 
564  public:
571  PyramidQuadrature( const GeometryType &geometry, int order, size_t id );
572 
574  virtual GeometryType geometryType () const
575  {
576  return GeometryType( topologyId, 3 );
577  }
578 
580  virtual int order () const
581  {
582  return order_;
583  }
584 
586  static size_t maxOrder ()
587  {
589  }
590  };
591 
592  } // end namespace Fem
593 
594 } // end namespace Dune
595 
596 #include "femquadratures_inline.hh"
597 
598 #endif // #ifndef DUNE_FEM_FEMQUADRATURES_HH
static int maxOrder(const int dim)
Definition: femquadratures.hh:25
Definition: femquadratures.hh:20
FieldImp FieldType
Definition: femquadratures.hh:489
FieldImp FieldType
Definition: femquadratures.hh:124
BaseType::CoordinateType CoordinateType
type of local coordinates
Definition: quadratureimp.hh:191
virtual int order() const
obtain order of the integration point list
Definition: femquadratures.hh:337
virtual int order() const
obtain order of the integration point list
Definition: femquadratures.hh:520
Definition: femquadratures.hh:23
int order_
Definition: femquadratures.hh:135
virtual int order() const
obtain order of the integration point list
Definition: femquadratures.hh:460
static size_t maxOrder()
maximal order of available quadratures
Definition: femquadratures.hh:404
BaseType::CoordinateType CoordinateType
type of local coordinates
Definition: femquadratures.hh:557
virtual int order() const
obtain order of the integration point list
Definition: femquadratures.hh:89
Definition: femquadratures.hh:485
FieldImp FieldType
Definition: femquadratures.hh:306
virtual int order() const
obtain order of the integration point list
Definition: femquadratures.hh:398
FieldImp FieldType
Definition: femquadratures.hh:367
static size_t maxOrder()
maximal order of available quadratures
Definition: femquadratures.hh:526
virtual GeometryType geometryType() const
Definition: femquadratures.hh:149
int order_
Definition: femquadratures.hh:67
FieldImp FieldType
Definition: femquadratures.hh:244
virtual int order() const
obtain order of the integration point list
Definition: femquadratures.hh:580
Definition: femquadratures.hh:302
Definition: pyramidpoints.hh:20
static size_t maxOrder()
maximal order of available quadratures
Definition: femquadratures.hh:466
virtual int order() const
obtain order of the integration point list
Definition: femquadratures.hh:155
BaseType::CoordinateType CoordinateType
type of local coordinates
Definition: femquadratures.hh:497
BaseType::CoordinateType CoordinateType
type of local coordinates
Definition: femquadratures.hh:64
BaseType::CoordinateType CoordinateType
type of local coordinates
Definition: femquadratures.hh:132
virtual GeometryType geometryType() const
Definition: femquadratures.hh:331
virtual GeometryType geometryType() const
Definition: femquadratures.hh:392
static size_t maxOrder()
maximal order of available quadratures
Definition: femquadratures.hh:281
Definition: femquadratures.hh:179
BaseType::CoordinateType CoordinateType
type of local coordinates
Definition: femquadratures.hh:375
Definition: femquadratures.hh:120
Definition: coordinate.hh:4
virtual GeometryType geometryType() const
Definition: femquadratures.hh:82
BaseType::CoordinateType CoordinateType
type of local coordinates
Definition: femquadratures.hh:314
Definition: femquadratures.hh:545
static size_t maxOrder()
maximal order of available quadratures
Definition: femquadratures.hh:586
BaseType::CoordinateType CoordinateType
type of local coordinates
Definition: femquadratures.hh:191
static size_t maxOrder()
maximal order of available quadratures
Definition: femquadratures.hh:161
int order_
Definition: femquadratures.hh:194
Definition: femquadratures.hh:23
static size_t maxOrder()
maximal order of available quadratures
Definition: femquadratures.hh:95
Definition: femquadratures.hh:363
Definition: femquadratures.hh:240
FieldImp FieldType
Definition: femquadratures.hh:56
Generic implementation of a Dune quadrature.
Definition: quadratureimp.hh:178
FieldImp FieldType
Definition: femquadratures.hh:429
Definition: femquadratures.hh:52
BaseType::CoordinateType CoordinateType
type of local coordinates
Definition: femquadratures.hh:252
virtual GeometryType geometryType() const
Definition: femquadratures.hh:269
virtual int order() const
Definition: femquadratures.hh:214
BaseType::CoordinateType CoordinateType
type of local coordinates
Definition: femquadratures.hh:437
Definition: femquadratures.hh:425
FieldImp FieldType
Definition: femquadratures.hh:549
virtual GeometryType geometryType() const
Definition: femquadratures.hh:574
virtual GeometryType geometryType() const
Definition: femquadratures.hh:454
virtual GeometryType geometryType() const
Definition: femquadratures.hh:514
virtual GeometryType geometryType() const
Definition: femquadratures.hh:208
virtual int order() const
obtain order of the integration point list
Definition: femquadratures.hh:275
FieldImp FieldType
Definition: femquadratures.hh:183
Definition: femquadratures.hh:23
static size_t maxOrder()
maximal order of available quadratures
Definition: femquadratures.hh:220
Definition: gausspoints.hh:29
static size_t maxOrder()
maximal order of available quadratures
Definition: femquadratures.hh:343