dune-localfunctions  2.6-git
pk1dlocalinterpolation.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_Pk1DLOCALINTERPOLATION_HH
4 #define DUNE_Pk1DLOCALINTERPOLATION_HH
5 
6 #include <vector>
7 
8 namespace Dune
9 {
10  template<class LB>
12  {
14  enum {N = LB::N};
15 
17  enum {k = LB::O};
18 
19  private:
20  static const int kdiv = (k == 0 ? 1 : k);
21 
22  public:
23 
24  template<typename F, typename C>
25  void interpolate (const F& f, std::vector<C>& out) const
26  {
27  typename LB::Traits::DomainType x;
28  typename LB::Traits::RangeType y;
29  typedef typename LB::Traits::DomainFieldType D;
30  out.resize(N);
31 
32  for (int i=0; i<N; i++)
33  {
34  x[0] = ((D)i)/((D)kdiv);
35  f.evaluate(x,y);
36  out[i] = y;
37  }
38  }
39 
40  };
41 }
42 
43 #endif
Definition: pk1dlocalinterpolation.hh:11
Definition: brezzidouglasmarini1cube2dlocalbasis.hh:15
void interpolate(const F &f, std::vector< C > &out) const
Definition: pk1dlocalinterpolation.hh:25