5#ifndef DUNE_DUAL_Q1_LOCALINTERPOLATION_HH
6#define DUNE_DUAL_Q1_LOCALINTERPOLATION_HH
11#include <dune/common/fvector.hh>
12#include <dune/common/fmatrix.hh>
20 template<
int dim,
class LB>
32 template<
typename F,
typename C>
35 typename LB::Traits::DomainType x;
37 const int size = 1<<dim;
40 Dune::FieldVector<C,size> q1Coefficients;
42 for (
int i=0; i< (1<<dim); i++) {
47 for (
int j=0; j<dim; j++)
48 x[j] = (i & (1<<j)) ? 1.0 : 0.0;
50 q1Coefficients[i] = f(x);
57 Dune::FieldMatrix<C,size,size> mat;
59 for (
int i=0; i<size; i++)
60 for (
int j=0; j<size; j++)
61 mat[i][j] = coefficients_[j][i];
64 Dune::FieldVector<C,size> sol(0);
66 mat.solve(sol,q1Coefficients);
69 for (
int i=0; i<size; i++)
74 std::array<Dune::FieldVector<
typename LB::Traits::RangeFieldType, (1<<dim)> ,(1<<dim)>
coefficients_;
Definition bdfmcube.hh:18
const EdgeS0_5FiniteElement< Geometry, RF >::Traits::Coefficients & EdgeS0_5FiniteElement< Geometry, RF >::coefficients_
Definition edges0.5.hh:84
const int RannacherTurek3DLocalBasis< D, R >::coefficients[6][6]
Definition rannacherturek3dlocalbasis.hh:121
Definition dualq1localinterpolation.hh:22
void setCoefficients(const std::array< Dune::FieldVector< typename LB::Traits::RangeFieldType,(1<< dim)>,(1<< dim)> &coefficients)
Definition dualq1localinterpolation.hh:25
void interpolate(const F &f, std::vector< C > &out) const
Local interpolation of a function.
Definition dualq1localinterpolation.hh:33