3#ifndef DUNE_HIERARCHICAL_SIMPLEX_P2_LOCALINTERPOLATION_HH
4#define DUNE_HIERARCHICAL_SIMPLEX_P2_LOCALINTERPOLATION_HH
18 template<
typename F,
typename C>
19 void interpolate (
const F& f, std::vector<C>& out)
const
21 typename LB::Traits::DomainType x;
22 typename LB::Traits::RangeType y;
24 static_assert(LB::Traits::dimDomain <= 3,
25 "LocalInterpolation for HierarchicalSimplexP2 finite elements"
26 " is only implemented for dimDomain <=3!");
28 switch (
int(LB::Traits::dimDomain)) {
35 x[0] = 0.0; f.evaluate(x, y); out[0] = y;
36 x[0] = 1.0; f.evaluate(x, y); out[2] = y;
39 x[0] = 0.5; f.evaluate(x, y);
40 out[1] = y - 0.5*(out[0] + out[2]);
50 x[0] = 0.0; x[1] = 0.0; f.evaluate(x, y); out[0] = y;
51 x[0] = 1.0; x[1] = 0.0; f.evaluate(x, y); out[2] = y;
52 x[0] = 0.0; x[1] = 1.0; f.evaluate(x, y); out[5] = y;
55 x[0] = 0.5; x[1] = 0.0; f.evaluate(x, y);
56 out[1] = y - 0.5*(out[0] + out[2]);
58 x[0] = 0.0; x[1] = 0.5; f.evaluate(x, y);
59 out[3] = y - 0.5*(out[0] + out[5]);
61 x[0] = 0.5; x[1] = 0.5; f.evaluate(x, y);
62 out[4] = y - 0.5*(out[2] + out[5]);
71 x[0] = 0.0; x[1] = 0.0; x[2] = 0.0; f.evaluate(x, y); out[0] = y;
72 x[0] = 1.0; x[1] = 0.0; x[2] = 0.0; f.evaluate(x, y); out[2] = y;
73 x[0] = 0.0; x[1] = 1.0; x[2] = 0.0; f.evaluate(x, y); out[5] = y;
74 x[0] = 0.0; x[1] = 0.0; x[2] = 1.0; f.evaluate(x, y); out[9] = y;
77 x[0] = 0.5; x[1] = 0.0; x[2] = 0.0; f.evaluate(x, y);
78 out[1] = y - 0.5*(out[0] + out[2]);
80 x[0] = 0.0; x[1] = 0.5; x[2] = 0.0; f.evaluate(x, y);
81 out[3] = y - 0.5*(out[0] + out[5]);
83 x[0] = 0.5; x[1] = 0.5; x[2] = 0.0; f.evaluate(x, y);
84 out[4] = y - 0.5*(out[2] + out[5]);
86 x[0] = 0.0; x[1] = 0.0; x[2] = 0.5; f.evaluate(x, y);
87 out[6] = y - 0.5*(out[0] + out[9]);
89 x[0] = 0.5; x[1] = 0.0; x[2] = 0.5; f.evaluate(x, y);
90 out[7] = y - 0.5*(out[2] + out[9]);
92 x[0] = 0.0; x[1] = 0.5; x[2] = 0.5; f.evaluate(x, y);
93 out[8] = y - 0.5*(out[5] + out[9]);
Definition: hierarchicalsimplexp2localinterpolation.hh:15
Dune namespace.
Definition: alignedallocator.hh:10