5#ifndef DUNE_HIERARCHICAL_SIMPLEX_P2_LOCALINTERPOLATION_HH
6#define DUNE_HIERARCHICAL_SIMPLEX_P2_LOCALINTERPOLATION_HH
9#include <dune/localfunctions/common/localinterpolation.hh>
21 template<
typename F,
typename C>
22 void interpolate (
const F& ff, std::vector<C>& out)
const
24 typename LB::Traits::DomainType x;
25 typename LB::Traits::RangeType y;
27 auto&& f = Impl::makeFunctionWithCallOperator<decltype(x)>(ff);
29 static_assert(LB::Traits::dimDomain <= 3,
30 "LocalInterpolation for HierarchicalSimplexP2 finite elements"
31 " is only implemented for dimDomain <=3!");
33 switch (
int(LB::Traits::dimDomain)) {
40 x[0] = 0.0; out[0] = f(x);
41 x[0] = 1.0; out[2] = f(x);
45 out[1] = y - 0.5*(out[0] + out[2]);
55 x[0] = 0.0; x[1] = 0.0; out[0] = f(x);
56 x[0] = 1.0; x[1] = 0.0; out[2] = f(x);
57 x[0] = 0.0; x[1] = 1.0; out[5] = f(x);
60 x[0] = 0.5; x[1] = 0.0; y = f(x);
61 out[1] = y - 0.5*(out[0] + out[2]);
63 x[0] = 0.0; x[1] = 0.5; y = f(x);
64 out[3] = y - 0.5*(out[0] + out[5]);
66 x[0] = 0.5; x[1] = 0.5; y = f(x);
67 out[4] = y - 0.5*(out[2] + out[5]);
76 x[0] = 0.0; x[1] = 0.0; x[2] = 0.0; out[0] = f(x);
77 x[0] = 1.0; x[1] = 0.0; x[2] = 0.0; out[2] = f(x);
78 x[0] = 0.0; x[1] = 1.0; x[2] = 0.0; out[5] = f(x);
79 x[0] = 0.0; x[1] = 0.0; x[2] = 1.0; out[9] = f(x);
82 x[0] = 0.5; x[1] = 0.0; x[2] = 0.0; y = f(x);
83 out[1] = y - 0.5*(out[0] + out[2]);
85 x[0] = 0.0; x[1] = 0.5; x[2] = 0.0; y = f(x);
86 out[3] = y - 0.5*(out[0] + out[5]);
88 x[0] = 0.5; x[1] = 0.5; x[2] = 0.0; y = f(x);
89 out[4] = y - 0.5*(out[2] + out[5]);
91 x[0] = 0.0; x[1] = 0.0; x[2] = 0.5; y = f(x);
92 out[6] = y - 0.5*(out[0] + out[9]);
94 x[0] = 0.5; x[1] = 0.0; x[2] = 0.5; y = f(x);
95 out[7] = y - 0.5*(out[2] + out[9]);
97 x[0] = 0.0; x[1] = 0.5; x[2] = 0.5; y = f(x);
98 out[8] = y - 0.5*(out[5] + out[9]);
Definition: hierarchicalsimplexp2localinterpolation.hh:18
Dune namespace.
Definition: alignedallocator.hh:13