5#ifndef DUNE_REFINED_P0_LOCALINTERPOLATION_HH
6#define DUNE_REFINED_P0_LOCALINTERPOLATION_HH
8#include <dune/localfunctions/refined/refinedp0/refinedp0localbasis.hh>
9#include <dune/localfunctions/common/localinterpolation.hh>
14 class RefinedP0LocalInterpolation
17 template<
class D,
class R>
18 class RefinedP0LocalInterpolation<RefinedP0LocalBasis<D,R,1> >
20 typedef RefinedP0LocalBasis<D,R,1> LB;
21 typedef typename LB::Traits::DomainType DT;
24 RefinedP0LocalInterpolation() :
25 interpolationPoints_(2)
28 interpolationPoints_[0][0] = 1.0/4.0;
30 interpolationPoints_[1][0] = 3.0/4.0;
34 template<
typename F,
typename C>
35 void interpolate (
const F& ff, std::vector<C>& out)
const
37 auto&& f = Impl::makeFunctionWithCallOperator<DT>(ff);
39 out.resize(interpolationPoints_.size());
40 for (
size_t i = 0; i < out.size(); ++i)
42 out[i] = f(interpolationPoints_[i]);
47 std::vector<DT> interpolationPoints_;
50 template<
class D,
class R>
51 class RefinedP0LocalInterpolation<RefinedP0LocalBasis<D,R,2> >
53 typedef RefinedP0LocalBasis<D,R,2> LB;
54 typedef typename LB::Traits::DomainType DT;
57 RefinedP0LocalInterpolation() :
58 interpolationPoints_(4)
61 interpolationPoints_[0][0] = 1.0/6;
62 interpolationPoints_[0][1] = 1.0/6;
64 interpolationPoints_[1][0] = 4.0/6;
65 interpolationPoints_[1][1] = 1.0/6;
67 interpolationPoints_[2][0] = 1.0/6;
68 interpolationPoints_[2][1] = 4.0/6;
70 interpolationPoints_[3][0] = 2.0/6;
71 interpolationPoints_[3][1] = 2.0/6;
75 template<
typename F,
typename C>
76 void interpolate (
const F& ff, std::vector<C>& out)
const
78 auto&& f = Impl::makeFunctionWithCallOperator<DT>(ff);
80 out.resize(interpolationPoints_.size());
81 for (
size_t i = 0; i < out.size(); ++i)
83 out[i] = f(interpolationPoints_[i]);
88 std::vector<DT> interpolationPoints_;
91 template<
class D,
class R>
92 class RefinedP0LocalInterpolation<RefinedP0LocalBasis<D,R,3> >
94 typedef RefinedP0LocalBasis<D,R,3> LB;
95 typedef typename LB::Traits::DomainType DT;
98 RefinedP0LocalInterpolation() :
99 interpolationPoints_(8)
102 interpolationPoints_[0][0] = 1.0/8;
103 interpolationPoints_[0][1] = 1.0/8;
104 interpolationPoints_[0][2] = 1.0/8;
106 interpolationPoints_[1][0] = 5.0/8;
107 interpolationPoints_[1][1] = 1.0/8;
108 interpolationPoints_[1][2] = 1.0/8;
110 interpolationPoints_[2][0] = 1.0/8;
111 interpolationPoints_[2][1] = 5.0/8;
112 interpolationPoints_[2][2] = 1.0/8;
114 interpolationPoints_[3][0] = 1.0/8;
115 interpolationPoints_[3][1] = 1.0/8;
116 interpolationPoints_[3][2] = 5.0/8;
118 interpolationPoints_[4][0] = 1.0/4;
119 interpolationPoints_[4][1] = 1.0/8;
120 interpolationPoints_[4][2] = 1.0/4;
122 interpolationPoints_[5][0] = 3.0/8;
123 interpolationPoints_[5][1] = 1.0/4;
124 interpolationPoints_[5][2] = 1.0/8;
126 interpolationPoints_[6][0] = 1.0/8;
127 interpolationPoints_[6][1] = 1.0/4;
128 interpolationPoints_[6][2] = 3.0/8;
130 interpolationPoints_[7][0] = 1.0/4;
131 interpolationPoints_[7][1] = 3.0/8;
132 interpolationPoints_[7][2] = 1.0/4;
136 template<
typename F,
typename C>
137 void interpolate (
const F& ff, std::vector<C>& out)
const
139 auto&& f = Impl::makeFunctionWithCallOperator<DT>(ff);
141 out.resize(interpolationPoints_.size());
142 for (
size_t i = 0; i < out.size(); ++i)
144 out[i] = f(interpolationPoints_[i]);
149 std::vector<DT> interpolationPoints_;
Dune namespace.
Definition: alignedallocator.hh:13