3#ifndef DUNE_DUAL_P1_LOCALINTERPOLATION_HH
4#define DUNE_DUAL_P1_LOCALINTERPOLATION_HH
10 template<
int dim,
class LB>
11 class DualP1LocalInterpolation
15 template<
typename F,
typename C>
16 void interpolate (
const F& f, std::vector<C>& out)
const
18 typename LB::Traits::RangeType y;
19 typename LB::Traits::DomainType x;
22 const int faceDual(LB::faceDual);
25 std::vector<C> p1Interpolation(dim+1);
28 for (
int i=0; i<dim; i++)
30 f.evaluate(x,y); p1Interpolation[0] = y;
33 for (
int i=0; i<dim; i++) {
34 for (
int j=0; j<dim; j++)
37 f.evaluate(x,y); p1Interpolation[i+1] = y;
43 for (
int i=0; i<dim+1; i++) {
44 out[i] = 2*p1Interpolation[i]/(dim+2-faceDual);
46 for (
int j=0; j<i; j++)
47 out[i] += p1Interpolation[j]/(dim+2-faceDual);
49 for (
int j=i+1; j<=dim; j++)
50 out[i] += p1Interpolation[j]/(dim+2-faceDual);
Dune namespace.
Definition: alignedallocator.hh:10