3#ifndef DUNE_LOCALFUNCTIONS_MONOMIAL_MONOMIALLOCALINTERPOLATION_HH
4#define DUNE_LOCALFUNCTIONS_MONOMIAL_MONOMIALLOCALINTERPOLATION_HH
17 template<
class LB,
unsigned int size>
18 class MonomialLocalInterpolation
20 typedef typename LB::Traits::DomainType D;
21 typedef typename LB::Traits::DomainFieldType DF;
22 static const int dimD=LB::Traits::dimDomain;
23 typedef typename LB::Traits::RangeType R;
24 typedef typename LB::Traits::RangeFieldType RF;
26 typedef QuadratureRule<DF,dimD> QR;
30 MonomialLocalInterpolation (
const GeometryType >_,
32 :
gt(gt_), lb(lb_), Minv(0)
33 , qr(QuadratureRules<DF,dimD>::rule(
gt, 2*lb.order()))
37 DUNE_THROW(Exception,
"size template parameter does not match size of "
40 const QRiterator qrend = qr.end();
41 for(QRiterator qrit = qr.begin(); qrit != qrend; ++qrit) {
43 lb.evaluateFunction(qrit->position(),base);
45 for(
unsigned int i = 0; i < size; ++i)
46 for(
unsigned int j = 0; j < size; ++j)
47 Minv[i][j] += qrit->weight() * base[i] * base[j];
59 template<
typename F,
typename C>
60 void interpolate (
const F& f, std::vector<C>& out)
const
65 const QRiterator qrend = qr.end();
66 for(QRiterator qrit = qr.begin(); qrit != qrend; ++qrit) {
69 f.evaluate(qrit->position(),y);
72 lb.evaluateFunction(qrit->position(),base);
74 for(
unsigned int i = 0; i < size; ++i)
75 for(
unsigned int j = 0; j < size; ++j)
76 out[i] += Minv[i][j] * qrit->weight() * y * base[j];
83 FieldMatrix<RF, size, size> Minv;
std::vector< QuadraturePoint< ct, dim > >::const_iterator iterator
Definition: quadraturerules.hh:128
GeometryType
Type representing VTK's entity geometry types.
Definition: common.hh:178
Implements a matrix constructed from a given type representing a field and compile-time given number ...
Implements a vector constructed from a given type representing a field and a compile-time given size.
#define DUNE_THROW(E, m)
Definition: exceptions.hh:216
bool gt(const T &first, const T &second, typename EpsilonType< T >::Type epsilon)
test if first greater than second
Definition: float_cmp.cc:147
Dune namespace.
Definition: alignedallocator.hh:10
A unique label for each type of element that can occur in a grid.