Dune Core Modules (2.6.0)

pk1dlocalinterpolation.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_Pk1DLOCALINTERPOLATION_HH
4#define DUNE_Pk1DLOCALINTERPOLATION_HH
5
6#include <vector>
7
8namespace Dune
9{
10 template<class LB>
11 class Pk1DLocalInterpolation
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
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)