dune-localfunctions  2.2.1
prismp1localinterpolation.hh
Go to the documentation of this file.
1 // -*- tab-width: 4; indent-tabs-mode: nil -*-
2 #ifndef DUNE_PRISM_P1_LOCALINTERPOLATION_HH
3 #define DUNE_PRISM_P1_LOCALINTERPOLATION_HH
4 
5 #include <vector>
6 
7 namespace Dune
8 {
9  template<class LB>
11  {
12  public:
14  {
15  x[0][0] = 0.0; x[0][1] = 0.0; x[0][2] = 0.0;
16  x[1][0] = 1.0; x[1][1] = 0.0; x[1][2] = 0.0;
17  x[2][0] = 0.0; x[2][1] = 1.0; x[2][2] = 0.0;
18  x[3][0] = 0.0; x[3][1] = 0.0; x[3][2] = 1.0;
19  x[4][0] = 1.0; x[4][1] = 0.0; x[4][2] = 1.0;
20  x[5][0] = 0.0; x[5][1] = 1.0; x[5][2] = 1.0;
21  }
22 
24  template<typename F, typename C>
25  void interpolate (const F& f, std::vector<C>& out) const
26  {
27  typename LB::Traits::RangeType y;
28 
29  out.resize(6);
30  f.evaluate(x[0],y); out[0] = y;
31  f.evaluate(x[1],y); out[1] = y;
32  f.evaluate(x[2],y); out[2] = y;
33  f.evaluate(x[3],y); out[3] = y;
34  f.evaluate(x[4],y); out[4] = y;
35  f.evaluate(x[5],y); out[5] = y;
36  }
37 
38  private:
39  typename LB::Traits::DomainType x[6];
40  };
41 }
42 
43 #endif