3#ifndef DUNE_REFINED_P0_LOCALINTERPOLATION_HH
4#define DUNE_REFINED_P0_LOCALINTERPOLATION_HH
6#include <dune/localfunctions/refined/refinedp0/refinedp0localbasis.hh>
7#include <dune/localfunctions/common/localinterpolation.hh>
12 class RefinedP0LocalInterpolation
15 template<
class D,
class R>
16 class RefinedP0LocalInterpolation<RefinedP0LocalBasis<D,R,1> >
18 typedef RefinedP0LocalBasis<D,R,1> LB;
19 typedef typename LB::Traits::DomainType DT;
22 RefinedP0LocalInterpolation() :
23 interpolationPoints_(2)
26 interpolationPoints_[0][0] = 1.0/4.0;
28 interpolationPoints_[1][0] = 3.0/4.0;
32 template<
typename F,
typename C>
33 void interpolate (
const F& ff, std::vector<C>& out)
const
35 auto&& f = Impl::makeFunctionWithCallOperator<DT>(ff);
37 out.resize(interpolationPoints_.size());
38 for (
size_t i = 0; i < out.size(); ++i)
40 out[i] = f(interpolationPoints_[i]);
45 std::vector<DT> interpolationPoints_;
48 template<
class D,
class R>
49 class RefinedP0LocalInterpolation<RefinedP0LocalBasis<D,R,2> >
51 typedef RefinedP0LocalBasis<D,R,2> LB;
52 typedef typename LB::Traits::DomainType DT;
55 RefinedP0LocalInterpolation() :
56 interpolationPoints_(4)
59 interpolationPoints_[0][0] = 1.0/6;
60 interpolationPoints_[0][1] = 1.0/6;
62 interpolationPoints_[1][0] = 4.0/6;
63 interpolationPoints_[1][1] = 1.0/6;
65 interpolationPoints_[2][0] = 1.0/6;
66 interpolationPoints_[2][1] = 4.0/6;
68 interpolationPoints_[3][0] = 2.0/6;
69 interpolationPoints_[3][1] = 2.0/6;
73 template<
typename F,
typename C>
74 void interpolate (
const F& ff, std::vector<C>& out)
const
76 auto&& f = Impl::makeFunctionWithCallOperator<DT>(ff);
78 out.resize(interpolationPoints_.size());
79 for (
size_t i = 0; i < out.size(); ++i)
81 out[i] = f(interpolationPoints_[i]);
86 std::vector<DT> interpolationPoints_;
89 template<
class D,
class R>
90 class RefinedP0LocalInterpolation<RefinedP0LocalBasis<D,R,3> >
92 typedef RefinedP0LocalBasis<D,R,3> LB;
93 typedef typename LB::Traits::DomainType DT;
96 RefinedP0LocalInterpolation() :
97 interpolationPoints_(8)
100 interpolationPoints_[0][0] = 1.0/8;
101 interpolationPoints_[0][1] = 1.0/8;
102 interpolationPoints_[0][2] = 1.0/8;
104 interpolationPoints_[1][0] = 5.0/8;
105 interpolationPoints_[1][1] = 1.0/8;
106 interpolationPoints_[1][2] = 1.0/8;
108 interpolationPoints_[2][0] = 1.0/8;
109 interpolationPoints_[2][1] = 5.0/8;
110 interpolationPoints_[2][2] = 1.0/8;
112 interpolationPoints_[3][0] = 1.0/8;
113 interpolationPoints_[3][1] = 1.0/8;
114 interpolationPoints_[3][2] = 5.0/8;
116 interpolationPoints_[4][0] = 1.0/4;
117 interpolationPoints_[4][1] = 1.0/8;
118 interpolationPoints_[4][2] = 1.0/4;
120 interpolationPoints_[5][0] = 3.0/8;
121 interpolationPoints_[5][1] = 1.0/4;
122 interpolationPoints_[5][2] = 1.0/8;
124 interpolationPoints_[6][0] = 1.0/8;
125 interpolationPoints_[6][1] = 1.0/4;
126 interpolationPoints_[6][2] = 3.0/8;
128 interpolationPoints_[7][0] = 1.0/4;
129 interpolationPoints_[7][1] = 3.0/8;
130 interpolationPoints_[7][2] = 1.0/4;
134 template<
typename F,
typename C>
135 void interpolate (
const F& ff, std::vector<C>& out)
const
137 auto&& f = Impl::makeFunctionWithCallOperator<DT>(ff);
139 out.resize(interpolationPoints_.size());
140 for (
size_t i = 0; i < out.size(); ++i)
142 out[i] = f(interpolationPoints_[i]);
147 std::vector<DT> interpolationPoints_;
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