5#ifndef DUNE_DUAL_P1_LOCALINTERPOLATION_HH
6#define DUNE_DUAL_P1_LOCALINTERPOLATION_HH
15 template<
int dim,
class LB>
16 class DualP1LocalInterpolation
20 template<
typename F,
typename C>
21 void interpolate (
const F& f, std::vector<C>& out)
const
23 typename LB::Traits::DomainType x;
26 const int faceDual(LB::faceDual);
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);
static void interpolate(const GridFunction &u, DiscreteFunction &v)
perform native interpolation of a discrete function space
Definition: interpolate.hh:54
Dune namespace.
Definition: alignedallocator.hh:13