dune-localfunctions
2.10
Loading...
Searching...
No Matches
dune
localfunctions
rannacherturek
rannachertureklocalinterpolation.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
// SPDX-FileCopyrightInfo: Copyright © DUNE Project contributors, see file LICENSE.md in module root
4
// SPDX-License-Identifier: LicenseRef-GPL-2.0-only-with-DUNE-exception
5
#ifndef DUNE_RANNACHER_TUREK_LOCALINTERPOLATION_HH
6
#define DUNE_RANNACHER_TUREK_LOCALINTERPOLATION_HH
7
8
#include <cassert>
9
#include <vector>
10
11
#include <dune/common/fvector.hh>
12
13
#include <dune/geometry/referenceelements.hh>
14
15
#include <
dune/localfunctions/common/localbasis.hh
>
16
17
namespace
Dune
18
{
19
29
template
<
class
D,
class
R,
unsigned
int
d >
30
class
RannacherTurekLocalInterpolation
31
{
32
typedef
LocalBasisTraits< D, d, FieldVector< D, d >
,
33
R, 1, FieldVector< R, 1 >,
34
FieldMatrix< R, 1, d > >
Traits
;
35
36
public
:
37
template
<
class
F,
class
C >
38
void
interpolate
(
const
F &f, std::vector< C > &out )
const
39
{
40
typedef
typename
Traits::DomainType
DomainType;
41
42
// get cubic reference element
43
auto
referenceElement = ReferenceElements< D, d >::cube();
44
45
const
int
size = 2*d;
46
assert( size == referenceElement.size( 1 ) );
47
48
// resize vector
49
out.resize( size );
50
51
// evaluate local function in barycenter of codim 1 subentities
52
for
(
int
i = 0; i < size; ++i )
53
{
54
const
DomainType &x = referenceElement.position( i, 1 );
55
out[ i ] = f(x);
56
}
57
}
58
59
};
60
61
}
// namespace Dune
62
63
#endif
// #ifndef DUNE_RANNACHER_TUREK_LOCALINTERPOLATION_HH
Dune
Definition
bdfmcube.hh:18
Dune::LocalBasisTraits
Type traits for LocalBasisVirtualInterface.
Definition
common/localbasis.hh:35
Dune::LocalBasisTraits::DomainType
D DomainType
domain type
Definition
common/localbasis.hh:43
Dune::RannacherTurekLocalInterpolation
please doc me
Definition
rannachertureklocalinterpolation.hh:31
Dune::RannacherTurekLocalInterpolation::interpolate
void interpolate(const F &f, std::vector< C > &out) const
Definition
rannachertureklocalinterpolation.hh:38
localbasis.hh
Generated by
1.9.8