DUNE PDELab (git)

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
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 {
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
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
A dense n x m matrix.
Definition: fmatrix.hh:117
vector space out of a tensor product of fields.
Definition: fvector.hh:91
please doc me
Definition: rannachertureklocalinterpolation.hh:31
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:13
constexpr std::integral_constant< std::size_t, sizeof...(II)> size(std::integer_sequence< T, II... >)
Return the size of the sequence.
Definition: integersequence.hh:75
static const ReferenceElement & cube()
get hypercube reference elements
Definition: referenceelements.hh:168
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  |  generated with Hugo v0.111.3 (Nov 24, 23:30, 2024)