5#ifndef DUNE_REFINED_P0_LOCALINTERPOLATION_HH
6#define DUNE_REFINED_P0_LOCALINTERPOLATION_HH
8#include <dune/localfunctions/refined/refinedp0/refinedp0localbasis.hh>
16 class RefinedP0LocalInterpolation
22 template<
class D,
class R>
23 class RefinedP0LocalInterpolation<RefinedP0LocalBasis<D,R,1> >
25 typedef RefinedP0LocalBasis<D,R,1> LB;
26 typedef typename LB::Traits::DomainType DT;
29 RefinedP0LocalInterpolation() :
30 interpolationPoints_(2)
33 interpolationPoints_[0][0] = 1.0/4.0;
35 interpolationPoints_[1][0] = 3.0/4.0;
39 template<
typename F,
typename C>
40 void interpolate (
const F& f, std::vector<C>& out)
const
42 out.resize(interpolationPoints_.size());
43 for (
size_t i = 0; i < out.size(); ++i)
45 out[i] = f(interpolationPoints_[i]);
50 std::vector<DT> interpolationPoints_;
56 template<
class D,
class R>
57 class RefinedP0LocalInterpolation<RefinedP0LocalBasis<D,R,2> >
59 typedef RefinedP0LocalBasis<D,R,2> LB;
60 typedef typename LB::Traits::DomainType DT;
63 RefinedP0LocalInterpolation() :
64 interpolationPoints_(4)
67 interpolationPoints_[0][0] = 1.0/6;
68 interpolationPoints_[0][1] = 1.0/6;
70 interpolationPoints_[1][0] = 4.0/6;
71 interpolationPoints_[1][1] = 1.0/6;
73 interpolationPoints_[2][0] = 1.0/6;
74 interpolationPoints_[2][1] = 4.0/6;
76 interpolationPoints_[3][0] = 2.0/6;
77 interpolationPoints_[3][1] = 2.0/6;
81 template<
typename F,
typename C>
82 void interpolate (
const F& f, std::vector<C>& out)
const
84 out.resize(interpolationPoints_.size());
85 for (
size_t i = 0; i < out.size(); ++i)
87 out[i] = f(interpolationPoints_[i]);
92 std::vector<DT> interpolationPoints_;
98 template<
class D,
class R>
99 class RefinedP0LocalInterpolation<RefinedP0LocalBasis<D,R,3> >
101 typedef RefinedP0LocalBasis<D,R,3> LB;
102 typedef typename LB::Traits::DomainType DT;
105 RefinedP0LocalInterpolation() :
106 interpolationPoints_(8)
109 interpolationPoints_[0][0] = 1.0/8;
110 interpolationPoints_[0][1] = 1.0/8;
111 interpolationPoints_[0][2] = 1.0/8;
113 interpolationPoints_[1][0] = 5.0/8;
114 interpolationPoints_[1][1] = 1.0/8;
115 interpolationPoints_[1][2] = 1.0/8;
117 interpolationPoints_[2][0] = 1.0/8;
118 interpolationPoints_[2][1] = 5.0/8;
119 interpolationPoints_[2][2] = 1.0/8;
121 interpolationPoints_[3][0] = 1.0/8;
122 interpolationPoints_[3][1] = 1.0/8;
123 interpolationPoints_[3][2] = 5.0/8;
125 interpolationPoints_[4][0] = 1.0/4;
126 interpolationPoints_[4][1] = 1.0/8;
127 interpolationPoints_[4][2] = 1.0/4;
129 interpolationPoints_[5][0] = 3.0/8;
130 interpolationPoints_[5][1] = 1.0/4;
131 interpolationPoints_[5][2] = 1.0/8;
133 interpolationPoints_[6][0] = 1.0/8;
134 interpolationPoints_[6][1] = 1.0/4;
135 interpolationPoints_[6][2] = 3.0/8;
137 interpolationPoints_[7][0] = 1.0/4;
138 interpolationPoints_[7][1] = 3.0/8;
139 interpolationPoints_[7][2] = 1.0/4;
143 template<
typename F,
typename C>
144 void interpolate (
const F& f, std::vector<C>& out)
const
146 out.resize(interpolationPoints_.size());
147 for (
size_t i = 0; i < out.size(); ++i)
149 out[i] = f(interpolationPoints_[i]);
154 std::vector<DT> interpolationPoints_;
Dune namespace.
Definition: alignedallocator.hh:13