3 #ifndef DUNE_LOCALFUNCTIONS_MONOMIAL_MONOMIALLOCALINTERPOLATION_HH 4 #define DUNE_LOCALFUNCTIONS_MONOMIAL_MONOMIALLOCALINTERPOLATION_HH 8 #include <dune/common/fvector.hh> 9 #include <dune/common/fmatrix.hh> 11 #include <dune/geometry/type.hh> 12 #include <dune/geometry/quadraturerules.hh> 17 template<
class LB,
unsigned int size>
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;
27 typedef typename QR::iterator QRiterator;
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>
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;
89 #endif //DUNE_LOCALFUNCTIONS_MONOMIAL_MONOMIALLOCALINTERPOLATION_HH Definition: monomiallocalinterpolation.hh:18
void interpolate(const F &f, std::vector< C > &out) const
Determine coefficients interpolating a given function.
Definition: monomiallocalinterpolation.hh:60
Definition: brezzidouglasmarini1cube2dlocalbasis.hh:15
MonomialLocalInterpolation(const GeometryType >_, const LB &lb_)
Definition: monomiallocalinterpolation.hh:30