Dune Core Modules (2.6.0)

prismp2localinterpolation.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_PRISM_P2_LOCALINTERPOLATION_HH
4#define DUNE_PRISM_P2_LOCALINTERPOLATION_HH
5
6#include <vector>
7
8namespace Dune
9{
10 template<class LB>
11 class PrismP2LocalInterpolation
12 {
13 public:
14
16 template<typename F, typename C>
17 void interpolate (const F& f, std::vector<C>& out) const
18 {
19 typename LB::Traits::RangeType y;
20
21 out.resize(18);
22 typename LB::Traits::DomainType x;
23
24 x[0] = 0.0; x[1] = 0.0; x[2] = 0.0;
25 f.evaluate(x,y); out[0] = y;
26
27 x[0] = 1.0; x[1] = 0.0; x[2] = 0.0;
28 f.evaluate(x,y); out[1] = y;
29
30 x[0] = 0.0; x[1] = 1.0; x[2] = 0.0;
31 f.evaluate(x,y); out[2] = y;
32
33 x[0] = 0.0; x[1] = 0.0; x[2] = 1.0;
34 f.evaluate(x,y); out[3] = y;
35
36 x[0] = 1.0; x[1] = 0.0; x[2] = 1.0;
37 f.evaluate(x,y); out[4] = y;
38
39 x[0] = 0.0; x[1] = 1.0; x[2] = 1.0;
40 f.evaluate(x,y); out[5] = y;
41
42 x[0] = 0.0; x[1] = 0.0; x[2] = 0.5;
43 f.evaluate(x,y); out[6] = y;
44
45 x[0] = 1.0; x[1] = 0.0; x[2] = 0.5;
46 f.evaluate(x,y); out[7] = y;
47
48 x[0] = 0; x[1] = 1.0; x[2] = 0.5;
49 f.evaluate(x,y); out[8] = y;
50
51 x[0] = 0.5; x[1] = 0.0; x[2] = 0.0;
52 f.evaluate(x,y); out[9] = y;
53
54 x[0] = 0.0; x[1] = 0.5; x[2] = 0.0;
55 f.evaluate(x,y); out[10] = y;
56
57 x[0] = 0.5; x[1] = 0.5; x[2] = 0.0;
58 f.evaluate(x,y); out[11] = y;
59
60 x[0] = 0.5; x[1] = 0.0; x[2] = 1.0;
61 f.evaluate(x,y); out[12] = y;
62
63 x[0] = 0.0; x[1] = 0.5; x[2] = 1.0;
64 f.evaluate(x,y); out[13] = y;
65
66 x[0] = 0.5; x[1] = 0.5; x[2] = 1.0;
67 f.evaluate(x,y); out[14] = y;
68
69 x[0] = 0.5; x[1] = 0.0; x[2] = 0.5;
70 f.evaluate(x,y); out[15] = y;
71
72 x[0] = 0.0; x[1] = 0.5; x[2] = 0.5;
73 f.evaluate(x,y); out[16] = y;
74
75 x[0] = 0.5; x[1] = 0.5; x[2] = 0.5;
76 f.evaluate(x,y); out[17] = y;
77 }
78
79 };
80}
81
82#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)