DUNE LocalFunctions (unstable)

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// 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
17namespace Dune
18{
19
29 template< class D, class R, unsigned int d >
31 {
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
please doc me
Definition: rannachertureklocalinterpolation.hh:31
Type traits for LocalBasisVirtualInterface.
Definition: localbasis.hh:35
D DomainType
domain type
Definition: localbasis.hh:43
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden & Uni Heidelberg  |  generated with Hugo v0.111.3 (May 27, 22:36, 2026)