1#ifndef DUNE_FEM_FEMQUADRATURES_HH
2#define DUNE_FEM_FEMQUADRATURES_HH
6#include <dune/fem/quadrature/quadratureimp.hh>
9#include "gausspoints.hh"
10#include "pyramidpoints.hh"
11#include "pardgsimplexquadrature.hh"
19 struct SimplexMaxOrder
22 enum { maxOrder1 = 39, maxOrder2 = 13, maxOrder3 = 12 };
24 static int maxOrder(
const int dim )
34 DUNE_THROW(NotImplemented,
"SimplexMaxOrder::maxOrder: wrong dimension");
50 template<
class FieldImp,
int dim >
51 class SimplexQuadrature
52 :
public QuadratureImp< FieldImp, dim >
55 typedef FieldImp FieldType;
58 typedef SimplexQuadrature< FieldType, dim > ThisType;
59 typedef QuadratureImp< FieldType, dim > BaseType;
75 SimplexQuadrature(
const GeometryType& geometry,
int order,
size_t id );
86 virtual int order ()
const
92 static size_t maxOrder ()
95 return SimplexMaxOrder::maxOrder1;
97 return SimplexMaxOrder::maxOrder2;
99 return SimplexMaxOrder::maxOrder3;
100 DUNE_THROW( NotImplemented,
"SimplexQuadratures from dim > 3 not implemented." );
116 template<
class FieldImp,
int dim >
117 class CubeQuadratureBase
118 :
public QuadratureImp< FieldImp, dim >
121 typedef FieldImp FieldType;
124 typedef CubeQuadratureBase< FieldType, dim > ThisType;
125 typedef QuadratureImp< FieldType, dim > BaseType;
142 template <
class QuadPo
ints>
143 CubeQuadratureBase(
const GeometryType &geometry,
144 int order,
size_t id,
145 const QuadPoints& pts );
154 virtual int order ()
const
160 static size_t maxOrder ()
176 template<
class FieldImp,
int dim >
177 class CubeQuadrature :
public CubeQuadratureBase< FieldImp, dim >
180 typedef FieldImp FieldType;
183 typedef CubeQuadrature< FieldType, dim > ThisType;
184 typedef CubeQuadratureBase< FieldType, dim > BaseType;
188 typedef typename BaseType :: CoordinateType CoordinateType;
197 CubeQuadrature(
const GeometryType &geometry,
int order,
size_t id )
198 : BaseType( geometry, order, id, GaussPts() )
216 template<
class FieldImp,
int dim >
217 class ModifiedNewtonCotesQuadrature :
public CubeQuadratureBase< FieldImp, dim >
220 typedef FieldImp FieldType;
223 typedef ModifiedNewtonCotesQuadrature< FieldType, dim > ThisType;
224 typedef CubeQuadratureBase< FieldType, dim > BaseType;
228 typedef typename BaseType :: CoordinateType CoordinateType;
237 ModifiedNewtonCotesQuadrature(
const GeometryType &geometry,
int order,
size_t id )
238 : BaseType( geometry, order, id, ModifiedNewtonCotes() )
254 template<
class FieldImp >
255 class PrismQuadrature
256 :
public QuadratureImp< FieldImp, 3 >
259 typedef FieldImp FieldType;
262 typedef PrismQuadrature< FieldType > ThisType;
263 typedef QuadratureImp< FieldType, 3 > BaseType;
279 PrismQuadrature(
const GeometryType &geometry,
int order,
size_t id );
288 virtual int order ()
const
294 static size_t maxOrder ()
296 return SimplexMaxOrder::maxOrder2;
312 template<
class FieldImp >
313 class PyramidQuadrature
314 :
public QuadratureImp< FieldImp, 3 >
317 typedef FieldImp FieldType;
320 typedef PyramidQuadrature< FieldType > ThisType;
321 typedef QuadratureImp< FieldType, 3 > BaseType;
337 PyramidQuadrature(
const GeometryType &geometry,
int order,
size_t id );
346 virtual int order ()
const
352 static size_t maxOrder ()
354 return PyramidPoints :: highest_order;
364 template<
class FieldImp,
int dim >
365 class PolyhedronQuadrature
366 :
public QuadratureImp< FieldImp, dim >
369 typedef FieldImp FieldType;
372 typedef PolyhedronQuadrature< FieldType, dim > ThisType;
373 typedef QuadratureImp< FieldType, dim > BaseType;
385 static const unsigned int topologyId = -1;
388 using BaseType :: points_;
389 using BaseType :: weights_;
398 PolyhedronQuadrature(
const GeometryType &geometry,
int order,
size_t id );
403 return geometryType_;
407 virtual int order ()
const
413 static size_t maxOrder ()
415 return SimplexMaxOrder::maxOrder( dim );
418 void reset(
const int order,
const int nop )
422 points_.reserve( nop );
424 weights_.reserve( nop );
434#include "femquadratures_inline.hh"
static const int highestOrder
highest quadrature order within the array
Definition: gausspoints.hh:114
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
GeometryType geometryType(const Dune::GeometryType &t)
mapping from GeometryType to VTKGeometryType
Definition: common.hh:151
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:132
#define DUNE_THROW(E, m)
Definition: exceptions.hh:218
constexpr GeometryType cube(unsigned int dim)
Returns a GeometryType representing a hypercube of dimension dim.
Definition: type.hh:462
constexpr GeometryType prism
GeometryType representing a 3D prism.
Definition: type.hh:528
constexpr GeometryType pyramid
GeometryType representing a 3D pyramid.
Definition: type.hh:522
constexpr GeometryType simplex(unsigned int dim)
Returns a GeometryType representing a simplex of dimension dim.
Definition: type.hh:453
Dune namespace.
Definition: alignedallocator.hh:13
A unique label for each type of element that can occur in a grid.