5#ifndef DUNE_DUAL_P1_LOCALINTERPOLATION_HH
6#define DUNE_DUAL_P1_LOCALINTERPOLATION_HH
9#include <dune/localfunctions/common/localinterpolation.hh>
13 template<
int dim,
class LB>
14 class DualP1LocalInterpolation
18 template<
typename F,
typename C>
19 void interpolate (
const F& ff, std::vector<C>& out)
const
21 typename LB::Traits::DomainType x;
24 const int faceDual(LB::faceDual);
26 auto&& f = Impl::makeFunctionWithCallOperator<decltype(x)>(ff);
29 std::vector<C> p1Interpolation(dim+1);
32 for (
int i=0; i<dim; i++)
34 p1Interpolation[0] = f(x);
37 for (
int i=0; i<dim; i++) {
38 for (
int j=0; j<dim; j++)
41 p1Interpolation[i+1] = f(x);
47 for (
int i=0; i<dim+1; i++) {
48 out[i] = 2*p1Interpolation[i]/(dim+2-faceDual);
50 for (
int j=0; j<i; j++)
51 out[i] += p1Interpolation[j]/(dim+2-faceDual);
53 for (
int j=i+1; j<=dim; j++)
54 out[i] += p1Interpolation[j]/(dim+2-faceDual);
Dune namespace.
Definition: alignedallocator.hh:13