Dune Core Modules (2.6.0)

pk3dlocalinterpolation.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_Pk3DLOCALINTERPOLATION_HH
4#define DUNE_Pk3DLOCALINTERPOLATION_HH
5
6#include <vector>
7
8namespace Dune
9{
10 template<class LB>
11 class Pk3DLocalInterpolation
12 {
13 enum {N = LB::N};
14 enum {k = LB::O};
15
16 private:
17 static const int kdiv = (k == 0 ? 1 : k);
18 public:
19
20 template<typename F, typename C>
21 void interpolate (const F& f, std::vector<C>& out) const
22 {
23 typename LB::Traits::DomainType x;
24 typename LB::Traits::RangeType y;
25 typedef typename LB::Traits::DomainFieldType D;
26 out.resize(N);
27 int n=0;
28 for (int i2 = 0; i2 <= k; i2++)
29 for (int i1 = 0; i1 <= k-i2; i1++)
30 for (int i0 = 0; i0 <= k-i1-i2; i0++)
31 {
32 x[0] = ((D)i0)/((D)kdiv);
33 x[1] = ((D)i1)/((D)kdiv);
34 x[2] = ((D)i2)/((D)kdiv);
35 f.evaluate(x,y);
36 out[n] = y;
37 n++;
38 }
39 }
40
41 };
42}
43
44#endif
Dune namespace.
Definition: alignedallocator.hh:10
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 24, 23:30, 2024)