dune-localfunctions 3.0-git
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#ifndef DUNE_RANNACHER_TUREK_LOCALINTERPOLATION_HH
4#define DUNE_RANNACHER_TUREK_LOCALINTERPOLATION_HH
5
6#include <cassert>
7#include <vector>
8
9#include <dune/common/fvector.hh>
10
11#include <dune/geometry/referenceelements.hh>
12
14
15namespace Dune
16{
17
25 template< class D, class R, unsigned int d >
27 {
29 R, 1, FieldVector< R, 1 >,
30 FieldMatrix< R, 1, d > > Traits;
31
32 public:
33 template< class F, class C >
34 void interpolate ( const F &f, std::vector< C > &out ) const
35 {
36 typedef typename Traits::DomainType DomainType;
37 typedef typename Traits::RangeType RangeType;
38
39 // get cubic reference element
40 const ReferenceElement< D, d > &referenceElement = ReferenceElements< D, d >::cube();
41
42 const int size = 2*d;
43 assert( size == referenceElement.size( 1 ) );
44
45 // resize vector
46 out.resize( size );
47
48 // evaluate local function in barycenter of codim 1 subentities
49 for( int i = 0; i < size; ++i )
50 {
51 const DomainType &x = referenceElement.position( i, 1 );
52 RangeType y;
53 f.evaluate( x, y );
54 out[ i ] = y;
55 }
56 }
57
58 };
59
60} // namespace Dune
61
62#endif // #ifndef DUNE_RANNACHER_TUREK_LOCALINTERPOLATION_HH
Definition brezzidouglasmarini1cube2d.hh:14
Type traits for LocalBasisVirtualInterface.
Definition localbasis.hh:38
R RangeType
range type
Definition localbasis.hh:61
D DomainType
domain type
Definition localbasis.hh:49
please doc me
Definition rannachertureklocalinterpolation.hh:27
void interpolate(const F &f, std::vector< C > &out) const
Definition rannachertureklocalinterpolation.hh:34