3#ifndef DUNE_DUAL_P1_LOCALINTERPOLATION_HH
4#define DUNE_DUAL_P1_LOCALINTERPOLATION_HH
7#include <dune/localfunctions/common/localinterpolation.hh>
11 template<
int dim,
class LB>
12 class DualP1LocalInterpolation
16 template<
typename F,
typename C>
17 void interpolate (
const F& ff, std::vector<C>& out)
const
19 typename LB::Traits::DomainType x;
22 const int faceDual(LB::faceDual);
24 auto&& f = Impl::makeFunctionWithCallOperator<decltype(x)>(ff);
27 std::vector<C> p1Interpolation(dim+1);
30 for (
int i=0; i<dim; i++)
32 p1Interpolation[0] = f(x);
35 for (
int i=0; i<dim; i++) {
36 for (
int j=0; j<dim; j++)
39 p1Interpolation[i+1] = f(x);
45 for (
int i=0; i<dim+1; i++) {
46 out[i] = 2*p1Interpolation[i]/(dim+2-faceDual);
48 for (
int j=0; j<i; j++)
49 out[i] += p1Interpolation[j]/(dim+2-faceDual);
51 for (
int j=i+1; j<=dim; j++)
52 out[i] += p1Interpolation[j]/(dim+2-faceDual);
void interpolate(const F &f, const GFS &gfs, XG &xg)
interpolation from a given grid function
Definition: interpolate.hh:177
Dune namespace.
Definition: alignedallocator.hh:11