Dune Core Modules (2.9.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 // SPDX-FileCopyrightInfo: Copyright (C) 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 #include <dune/localfunctions/common/localinterpolation.hh>
17 
18 namespace Dune
19 {
20 
28  template< class D, class R, unsigned int d >
30  {
32  R, 1, FieldVector< R, 1 >,
34 
35  public:
36  template< class F, class C >
37  void interpolate ( const F &ff, std::vector< C > &out ) const
38  {
39  typedef typename Traits::DomainType DomainType;
40 
41  auto&& f = Impl::makeFunctionWithCallOperator<DomainType>(ff);
42 
43  // get cubic reference element
45 
46  const int size = 2*d;
47  assert( size == referenceElement.size( 1 ) );
48 
49  // resize vector
50  out.resize( size );
51 
52  // evaluate local function in barycenter of codim 1 subentities
53  for( int i = 0; i < size; ++i )
54  {
55  const DomainType &x = referenceElement.position( i, 1 );
56  out[ i ] = f(x);
57  }
58  }
59 
60  };
61 
62 } // namespace Dune
63 
64 #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:95
please doc me
Definition: rannachertureklocalinterpolation.hh:30
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
static const ReferenceElement & cube()
get hypercube reference elements
Definition: referenceelements.hh:210
Type traits for LocalBasisVirtualInterface.
Definition: localbasis.hh:34
D DomainType
domain type
Definition: localbasis.hh:42
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.80.0 (May 1, 22:29, 2024)