3#ifndef DUNE_HIERARCHICAL_SIMPLEX_P2_LOCALINTERPOLATION_HH
4#define DUNE_HIERARCHICAL_SIMPLEX_P2_LOCALINTERPOLATION_HH
7#include <dune/localfunctions/common/localinterpolation.hh>
19 template<
typename F,
typename C>
20 void interpolate (
const F& ff, std::vector<C>& out)
const
22 typename LB::Traits::DomainType x;
23 typename LB::Traits::RangeType y;
25 auto&& f = Impl::makeFunctionWithCallOperator<decltype(x)>(ff);
27 static_assert(LB::Traits::dimDomain <= 3,
28 "LocalInterpolation for HierarchicalSimplexP2 finite elements"
29 " is only implemented for dimDomain <=3!");
31 switch (
int(LB::Traits::dimDomain)) {
38 x[0] = 0.0; out[0] = f(x);
39 x[0] = 1.0; out[2] = f(x);
43 out[1] = y - 0.5*(out[0] + out[2]);
53 x[0] = 0.0; x[1] = 0.0; out[0] = f(x);
54 x[0] = 1.0; x[1] = 0.0; out[2] = f(x);
55 x[0] = 0.0; x[1] = 1.0; out[5] = f(x);
58 x[0] = 0.5; x[1] = 0.0; y = f(x);
59 out[1] = y - 0.5*(out[0] + out[2]);
61 x[0] = 0.0; x[1] = 0.5; y = f(x);
62 out[3] = y - 0.5*(out[0] + out[5]);
64 x[0] = 0.5; x[1] = 0.5; y = f(x);
65 out[4] = y - 0.5*(out[2] + out[5]);
74 x[0] = 0.0; x[1] = 0.0; x[2] = 0.0; out[0] = f(x);
75 x[0] = 1.0; x[1] = 0.0; x[2] = 0.0; out[2] = f(x);
76 x[0] = 0.0; x[1] = 1.0; x[2] = 0.0; out[5] = f(x);
77 x[0] = 0.0; x[1] = 0.0; x[2] = 1.0; out[9] = f(x);
80 x[0] = 0.5; x[1] = 0.0; x[2] = 0.0; y = f(x);
81 out[1] = y - 0.5*(out[0] + out[2]);
83 x[0] = 0.0; x[1] = 0.5; x[2] = 0.0; y = f(x);
84 out[3] = y - 0.5*(out[0] + out[5]);
86 x[0] = 0.5; x[1] = 0.5; x[2] = 0.0; y = f(x);
87 out[4] = y - 0.5*(out[2] + out[5]);
89 x[0] = 0.0; x[1] = 0.0; x[2] = 0.5; y = f(x);
90 out[6] = y - 0.5*(out[0] + out[9]);
92 x[0] = 0.5; x[1] = 0.0; x[2] = 0.5; y = f(x);
93 out[7] = y - 0.5*(out[2] + out[9]);
95 x[0] = 0.0; x[1] = 0.5; x[2] = 0.5; y = f(x);
96 out[8] = y - 0.5*(out[5] + out[9]);
Definition: hierarchicalsimplexp2localinterpolation.hh:16
Dune namespace.
Definition: alignedallocator.hh:11