Dune Core Modules (2.6.0)

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
15namespace Dune
16{
17
25 template< class D, class R, unsigned int d >
27 {
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
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
A dense n x m matrix.
Definition: fmatrix.hh:68
vector space out of a tensor product of fields.
Definition: fvector.hh:93
please doc me
Definition: rannachertureklocalinterpolation.hh:27
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:10
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
R RangeType
range type
Definition: localbasis.hh:55
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Oct 13, 22:30, 2024)