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> 22 template<
class LB,
unsigned int size>
25 typedef typename LB::Traits::DomainType D;
26 typedef typename LB::Traits::DomainFieldType DF;
27 static const int dimD=LB::Traits::dimDomain;
28 typedef typename LB::Traits::RangeType R;
29 typedef typename LB::Traits::RangeFieldType RF;
31 typedef QuadratureRule<DF,dimD> QR;
32 typedef typename QR::iterator QRiterator;
37 : gt(gt_), lb(lb_), Minv(0)
38 , qr(QuadratureRules<DF,dimD>::rule(gt, 2*lb.order()))
42 DUNE_THROW(Exception,
"size template parameter does not match size of " 45 const QRiterator qrend = qr.end();
46 for(QRiterator qrit = qr.begin(); qrit != qrend; ++qrit) {
48 lb.evaluateFunction(qrit->position(),base);
50 for(
unsigned int i = 0; i < size; ++i)
51 for(
unsigned int j = 0; j < size; ++j)
52 Minv[i][j] += qrit->weight() * base[i] * base[j];
64 template<
typename F,
typename C>
70 const QRiterator qrend = qr.end();
71 for(QRiterator qrit = qr.begin(); qrit != qrend; ++qrit) {
73 R y = f(qrit->position());
76 lb.evaluateFunction(qrit->position(),base);
78 for(
unsigned int i = 0; i < size; ++i)
79 for(
unsigned int j = 0; j < size; ++j)
80 out[i] += Minv[i][j] * qrit->weight() * y * base[j];
87 FieldMatrix<RF, size, size> Minv;
93 #endif //DUNE_LOCALFUNCTIONS_MONOMIAL_MONOMIALLOCALINTERPOLATION_HH Definition: monomiallocalinterpolation.hh:23
void interpolate(const F &f, std::vector< C > &out) const
Determine coefficients interpolating a given function.
Definition: monomiallocalinterpolation.hh:65
Definition: bdfmcube.hh:17
MonomialLocalInterpolation(const GeometryType >_, const LB &lb_)
Definition: monomiallocalinterpolation.hh:35