Dune Core Modules (2.6.0)

pk2dlocalinterpolation.hh
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_Pk2DLOCALINTERPOLATION_HH
4#define DUNE_Pk2DLOCALINTERPOLATION_HH
5
6#include <vector>
7
8namespace Dune
9{
10 template<class LB>
11 class Pk2DLocalInterpolation
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 int n=0;
32 for (int j=0; j<=k; j++)
33 for (int i=0; i<=k-j; i++)
34 {
35 x[0] = ((D)i)/((D)kdiv); x[1] = ((D)j)/((D)kdiv);
36 f.evaluate(x,y);
37 out[n] = y;
38 n++;
39 }
40 }
41
42 };
43}
44
45#endif
Dune namespace.
Definition: alignedallocator.hh:10
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 15, 22:36, 2024)