dune-localfunctions
3.0-git
dune
localfunctions
lagrange
pk2d
pk2dlocalinterpolation.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_Pk2DLOCALINTERPOLATION_HH
4
#define DUNE_Pk2DLOCALINTERPOLATION_HH
5
6
#include <vector>
7
8
namespace
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
Definition
brezzidouglasmarini1cube2d.hh:14
Dune::Pk2DLocalInterpolation
Definition
pk2dlocalinterpolation.hh:12
Dune::Pk2DLocalInterpolation::interpolate
void interpolate(const F &f, std::vector< C > &out) const
Definition
pk2dlocalinterpolation.hh:25
Generated by
1.9.8