DUNE PDELab (2.8)

rannachertureklocalinterpolation.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_RANNACHER_TUREK_LOCALINTERPOLATION_HH
4#define DUNE_RANNACHER_TUREK_LOCALINTERPOLATION_HH
5
6#include <cassert>
7#include <vector>
8
10
11#include <dune/geometry/referenceelements.hh>
12
13#include <dune/localfunctions/common/localbasis.hh>
14#include <dune/localfunctions/common/localinterpolation.hh>
15
16namespace Dune
17{
18
26 template< class D, class R, unsigned int d >
28 {
32
33 public:
34 template< class F, class C >
35 void interpolate ( const F &ff, std::vector< C > &out ) const
36 {
37 typedef typename Traits::DomainType DomainType;
38
39 auto&& f = Impl::makeFunctionWithCallOperator<DomainType>(ff);
40
41 // get cubic reference element
43
44 const int size = 2*d;
45 assert( size == referenceElement.size( 1 ) );
46
47 // resize vector
48 out.resize( size );
49
50 // evaluate local function in barycenter of codim 1 subentities
51 for( int i = 0; i < size; ++i )
52 {
53 const DomainType &x = referenceElement.position( i, 1 );
54 out[ i ] = f(x);
55 }
56 }
57
58 };
59
60} // namespace Dune
61
62#endif // #ifndef DUNE_RANNACHER_TUREK_LOCALINTERPOLATION_HH
A dense n x m matrix.
Definition: fmatrix.hh:69
vector space out of a tensor product of fields.
Definition: fvector.hh:95
please doc me
Definition: rannachertureklocalinterpolation.hh:28
Implements a vector constructed from a given type representing a field and a compile-time given size.
unspecified value type referenceElement(T &&... t)
Returns a reference element for the objects t....
Dune namespace.
Definition: alignedallocator.hh:11
static const ReferenceElement & cube()
get hypercube reference elements
Definition: referenceelements.hh:208
Type traits for LocalBasisVirtualInterface.
Definition: localbasis.hh:32
D DomainType
domain type
Definition: localbasis.hh:43
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 21, 23:30, 2024)