1#ifndef DUNE_FEM_FEMQUADRATURES_INLINE_HH
2#define DUNE_FEM_FEMQUADRATURES_INLINE_HH
4#include "femquadratures.hh"
12#define SimplexPointsAdapter ParDGSimplexQuadrature::Quadrature
15 template <
class ct,
int dim>
16 SimplexQuadrature<ct, dim>::SimplexQuadrature(
const GeometryType&,
int order,
size_t id) :
17 QuadratureImp<ct, dim>(id),
18 order_((order <= 0) ? 1 : order)
21 assert( order_ <= SimplexMaxOrder :: maxOrder( dim ) );
23 SimplexPointsAdapter<dim> points(order);
25 order_ = points.order();
27 for (
int i = 0; i < points.numPoints(); ++i) {
28 this->addQuadraturePoint(points.point(i), points.weight(i));
32 template <
class ct,
int dim>
33 template <
class QuadPo
ints>
34 CubeQuadratureBase<ct, dim>::CubeQuadratureBase(
const GeometryType&,
int order,
size_t id,
const QuadPoints& gp) :
35 QuadratureImp<ct, dim>(id),
36 order_((order <= 0) ? 1 : order)
38 assert( order_ <= QuadPoints::highestOrder );
43 if constexpr ( dim == 0 )
45 typedef FieldVector< double, 0 > CoordinateType;
52 CoordinateType local( 0 );
55 this->addQuadraturePoint(local, weight);
61 for (
int i = 0; i <= GaussPts::MAXP; i++) {
62 if (gp.order(i)>=order_) {
68 if (m==0)
DUNE_THROW(NotImplemented,
"order " << order_ <<
" not implemented");
72 int n = gp.power(m,dim);
73 for (
int i = 0; i < n; i++) {
77 for (
int k=0; k<dim; ++k) {
85 for (
int k = 0; k < dim; k++)
87 local[k] = gp.point(m,x[k]);
88 weight *= gp.weight(m,x[k]);
92 this->addQuadraturePoint(local, weight);
99 PrismQuadrature<ct>::PrismQuadrature(
const GeometryType&,
int order,
size_t id) :
100 QuadratureImp<ct, 3>(id),
101 order_((order <= 0) ? 1 : order)
103 SimplexPointsAdapter<2> simplexPoints(order);
104 int simplexOrder = simplexPoints.order();
110 for (
int i = 0; i <= GaussPts::MAXP; i++) {
111 if (gp.order(i)>=order_) {
116 if (m==0)
DUNE_THROW(NotImplemented,
"order not implemented");
118 int gaussOrder = gp.order(m);
119 int minOrder = ((simplexOrder < gaussOrder) ? simplexOrder : gaussOrder);
122 int numSimplexPoints = simplexPoints.numPoints();
123 int numGaussPoints = gp.power(m,1);
125 FieldVector<ct, 3> local;
126 double weight, simplexWeight;
128 for (
int i = 0; i < numSimplexPoints; ++i) {
129 local[0] = simplexPoints.point(i)[0];
130 local[1] = simplexPoints.point(i)[1];
131 simplexWeight = simplexPoints.weight(i);
132 for (
int j = 0; j < numGaussPoints; ++j) {
133 local[2] = gp.point(m,j);
134 weight = simplexWeight;
135 weight *= gp.weight(m,j);
136 this->addQuadraturePoint(local, weight);
142 PyramidQuadrature<ct>::PyramidQuadrature(
const GeometryType&,
int order,
size_t id) :
143 QuadratureImp<ct, 3>(id),
144 order_((order <= 0) ? 1 : order)
146 const PyramidPoints points;
149 for (
int i = 0; i < PyramidPoints::numQuads; ++i) {
150 if (points.order(i) >= order_) {
156 if (m==0)
DUNE_THROW(NotImplemented,
"order not implemented");
157 order_ = points.order(m);
160 for (
int i = 0; i < points.numPoints(m); ++i) {
161 this->addQuadraturePoint(points.point(m, i), points.weight(m, i));
166 template <
class ct,
int dim>
167 PolyhedronQuadrature<ct, dim>::PolyhedronQuadrature(
const GeometryType& geomType,
int order,
size_t id) :
168 QuadratureImp<ct, dim>(id),
169 geometryType_( geomType ),
170 order_((order <= 0) ? 1 : order)
#define DUNE_THROW(E, m)
Definition: exceptions.hh:218
Dune namespace.
Definition: alignedallocator.hh:13