dune-localfunctions  2.2.1
rannacherturek2dlocalinterpolation.hh
Go to the documentation of this file.
1 #ifndef DUNE_RANNACHER_TUREK2DLOCALINTERPOLATION_HH
2 #define DUNE_RANNACHER_TUREK2DLOCALINTERPOLATION_HH
3 
4 #include <vector>
5 
6 
7 namespace Dune {
8 
9  template<class LB>
11  {
12  public:
13 
15  template<typename F, typename C>
16  void interpolate (const F& f, std::vector<C>& out) const {
17  typename LB::Traits::DomainType x;
18  typename LB::Traits::RangeType y;
19 
20  out.resize(4);
21  x[0] = 0.0; x[1] = 0.5; f.evaluate(x,y); out[0] = y;
22  x[0] = 1.0; x[1] = 0.5; f.evaluate(x,y); out[1] = y;
23  x[0] = 0.5; x[1] = 0.0; f.evaluate(x,y); out[2] = y;
24  x[0] = 0.5; x[1] = 1.0; f.evaluate(x,y); out[3] = y;
25  }
26  };
27 
28 } // namespace Dune
29 
30 #endif // DUNE_RANNACHER_TUREK2DLOCALINTERPOLATION_HH