3#ifndef DUNE_REFINED_P0_LOCALINTERPOLATION_HH
4#define DUNE_REFINED_P0_LOCALINTERPOLATION_HH
6#include <dune/localfunctions/refined/refinedp0/refinedp0localbasis.hh>
11 class RefinedP0LocalInterpolation
14 template<
class D,
class R>
15 class RefinedP0LocalInterpolation<RefinedP0LocalBasis<D,R,1> >
17 typedef RefinedP0LocalBasis<D,R,1> LB;
18 typedef typename LB::Traits::DomainType DT;
21 RefinedP0LocalInterpolation() :
22 interpolationPoints_(2)
25 interpolationPoints_[0][0] = 1.0/4.0;
27 interpolationPoints_[1][0] = 3.0/4.0;
31 template<
typename F,
typename C>
32 void interpolate (
const F& f, std::vector<C>& out)
const
34 typename LB::Traits::RangeType y;
35 out.resize(interpolationPoints_.size());
36 for (
size_t i = 0; i < out.size(); ++i)
38 f.evaluate(interpolationPoints_[i], y);
44 std::vector<DT> interpolationPoints_;
47 template<
class D,
class R>
48 class RefinedP0LocalInterpolation<RefinedP0LocalBasis<D,R,2> >
50 typedef RefinedP0LocalBasis<D,R,2> LB;
51 typedef typename LB::Traits::DomainType DT;
54 RefinedP0LocalInterpolation() :
55 interpolationPoints_(4)
58 interpolationPoints_[0][0] = 1.0/6;
59 interpolationPoints_[0][1] = 1.0/6;
61 interpolationPoints_[1][0] = 4.0/6;
62 interpolationPoints_[1][1] = 1.0/6;
64 interpolationPoints_[2][0] = 1.0/6;
65 interpolationPoints_[2][1] = 4.0/6;
67 interpolationPoints_[3][0] = 2.0/6;
68 interpolationPoints_[3][1] = 2.0/6;
72 template<
typename F,
typename C>
73 void interpolate (
const F& f, std::vector<C>& out)
const
75 typename LB::Traits::RangeType y;
76 out.resize(interpolationPoints_.size());
77 for (
size_t i = 0; i < out.size(); ++i)
79 f.evaluate(interpolationPoints_[i], y);
85 std::vector<DT> interpolationPoints_;
88 template<
class D,
class R>
89 class RefinedP0LocalInterpolation<RefinedP0LocalBasis<D,R,3> >
91 typedef RefinedP0LocalBasis<D,R,3> LB;
92 typedef typename LB::Traits::DomainType DT;
95 RefinedP0LocalInterpolation() :
96 interpolationPoints_(8)
99 interpolationPoints_[0][0] = 1.0/8;
100 interpolationPoints_[0][1] = 1.0/8;
101 interpolationPoints_[0][2] = 1.0/8;
103 interpolationPoints_[1][0] = 5.0/8;
104 interpolationPoints_[1][1] = 1.0/8;
105 interpolationPoints_[1][2] = 1.0/8;
107 interpolationPoints_[2][0] = 1.0/8;
108 interpolationPoints_[2][1] = 5.0/8;
109 interpolationPoints_[2][2] = 1.0/8;
111 interpolationPoints_[3][0] = 1.0/8;
112 interpolationPoints_[3][1] = 1.0/8;
113 interpolationPoints_[3][2] = 5.0/8;
115 interpolationPoints_[4][0] = 1.0/4;
116 interpolationPoints_[4][1] = 1.0/8;
117 interpolationPoints_[4][2] = 1.0/4;
119 interpolationPoints_[5][0] = 3.0/8;
120 interpolationPoints_[5][1] = 1.0/4;
121 interpolationPoints_[5][2] = 1.0/8;
123 interpolationPoints_[6][0] = 1.0/8;
124 interpolationPoints_[6][1] = 1.0/4;
125 interpolationPoints_[6][2] = 3.0/8;
127 interpolationPoints_[7][0] = 1.0/4;
128 interpolationPoints_[7][1] = 3.0/8;
129 interpolationPoints_[7][2] = 1.0/4;
133 template<
typename F,
typename C>
134 void interpolate (
const F& f, std::vector<C>& out)
const
136 typename LB::Traits::RangeType y;
137 out.resize(interpolationPoints_.size());
138 for (
size_t i = 0; i < out.size(); ++i)
140 f.evaluate(interpolationPoints_[i], y);
146 std::vector<DT> interpolationPoints_;
Dune namespace.
Definition: alignedallocator.hh:10