5 #ifndef DUNE_LOCALFUNCTIONS_MONOMIAL_MONOMIALLOCALINTERPOLATION_HH
6 #define DUNE_LOCALFUNCTIONS_MONOMIAL_MONOMIALLOCALINTERPOLATION_HH
10 #include <dune/common/fvector.hh>
11 #include <dune/common/fmatrix.hh>
13 #include <dune/geometry/type.hh>
14 #include <dune/geometry/quadraturerules.hh>
20 template<
class LB,
unsigned int size>
23 typedef typename LB::Traits::DomainType D;
24 typedef typename LB::Traits::DomainFieldType DF;
25 static const int dimD=LB::Traits::dimDomain;
26 typedef typename LB::Traits::RangeType R;
27 typedef typename LB::Traits::RangeFieldType RF;
29 typedef QuadratureRule<DF,dimD> QR;
30 typedef typename QR::iterator QRiterator;
35 : gt(gt_), lb(lb_), Minv(0)
36 , qr(QuadratureRules<DF,dimD>::rule(gt, 2*lb.order()))
40 DUNE_THROW(Exception,
"size template parameter does not match size of "
43 const QRiterator qrend = qr.end();
44 for(QRiterator qrit = qr.begin(); qrit != qrend; ++qrit) {
46 lb.evaluateFunction(qrit->position(),base);
48 for(
unsigned int i = 0; i < size; ++i)
49 for(
unsigned int j = 0; j < size; ++j)
50 Minv[i][j] += qrit->weight() * base[i] * base[j];
62 template<
typename F,
typename C>
65 using DomainType = std::decay_t<decltype(qr.begin()->position())>;
67 auto&& f = Impl::makeFunctionWithCallOperator<DomainType>(ff);
72 const QRiterator qrend = qr.end();
73 for(QRiterator qrit = qr.begin(); qrit != qrend; ++qrit) {
75 R y = f(qrit->position());
78 lb.evaluateFunction(qrit->position(),base);
80 for(
unsigned int i = 0; i < size; ++i)
81 for(
unsigned int j = 0; j < size; ++j)
82 out[i] += Minv[i][j] * qrit->weight() * y * base[j];
89 FieldMatrix<RF, size, size> Minv;
Definition: bdfmcube.hh:18
Definition: monomiallocalinterpolation.hh:22
void interpolate(const F &ff, std::vector< C > &out) const
Determine coefficients interpolating a given function.
Definition: monomiallocalinterpolation.hh:63
MonomialLocalInterpolation(const GeometryType >_, const LB &lb_)
Definition: monomiallocalinterpolation.hh:33