dune-localfunctions  2.6-git
pyramidp1localinterpolation.hh
Go to the documentation of this file.
1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 #ifndef DUNE_PYRAMID_P1_LOCALINTERPOLATION_HH
4 #define DUNE_PYRAMID_P1_LOCALINTERPOLATION_HH
5 
6 #include <vector>
7 
8 
9 namespace Dune
10 {
11  template<class LB>
13 
14  {
15  public:
17  {
18  x[0][0] = 0.0; x[0][1] = 0.0; x[0][2] = 0.0;
19  x[1][0] = 1.0; x[1][1] = 0.0; x[1][2] = 0.0;
20  x[2][0] = 0.0; x[2][1] = 1.0; x[2][2] = 0.0;
21  x[3][0] = 1.0; x[3][1] = 1.0; x[3][2] = 0.0;
22  x[4][0] = 0.0; x[4][1] = 0.0; x[4][2] = 1.0;
23  }
24 
26  template<typename F, typename C>
27  void interpolate (const F& f, std::vector<C>& out) const
28  {
29  typename LB::Traits::RangeType y;
30 
31  out.resize(5);
32  f.evaluate(x[0],y); out[0] = y;
33  f.evaluate(x[1],y); out[1] = y;
34  f.evaluate(x[2],y); out[2] = y;
35  f.evaluate(x[3],y); out[3] = y;
36  f.evaluate(x[4],y); out[4] = y;
37  }
38  private:
39  typename LB::Traits::DomainType x[5];
40  };
41 }
42 
43 #endif
Definition: pyramidp1localinterpolation.hh:12
Definition: brezzidouglasmarini1cube2dlocalbasis.hh:15
void interpolate(const F &f, std::vector< C > &out) const
Local interpolation of a function.
Definition: pyramidp1localinterpolation.hh:27
PyramidP1LocalInterpolation()
Definition: pyramidp1localinterpolation.hh:16