DUNE-FEM (unstable)

interpolation.hh
1#ifndef DUNE_FEM_SPACE_FINITEVOLUME_INTERPOLATION_HH
2#define DUNE_FEM_SPACE_FINITEVOLUME_INTERPOLATION_HH
3
4#include <functional>
5
6#include <dune/fem/function/localfunction/average.hh>
7
8#include "basisfunctionset.hh"
9
10namespace Dune
11{
12
13 namespace Fem
14 {
15
16 // FiniteVolumeLocalInterpolation
17 // ------------------------------
18
19 template< class GridPart, class Range >
20 class FiniteVolumeLocalInterpolation
21 {
22 typedef FiniteVolumeLocalInterpolation< GridPart, Range > ThisType;
23
24 public:
26 typedef GridPart GridPartType;
28 typedef typename GridPartType::template Codim< 0 >::EntityType EntityType;
29
31 typedef FiniteVolumeBasisFunctionSet< EntityType, Range > BasisFunctionSetType;
32
37 FiniteVolumeLocalInterpolation () {}
38
39 void bind( const EntityType &entity ) {}
40 void unbind() {}
41
42 /*
43 explicit FiniteVolumeLocalInterpolation ( const EntityType &entity )
44 : entity_( entity )
45 {}
46 */
47
54 FiniteVolumeLocalInterpolation ( const ThisType & ) = default;
55
56 FiniteVolumeLocalInterpolation &operator= ( const ThisType & ) = default;
57
65 /*
66 BasisFunctionSetType basisFunctionSet () const
67 {
68 return BasisFunctionSetType( entity() );
69 }
70 */
71
73 template< class LocalFunction, class LocalDofVector >
74 void operator() ( const LocalFunction &localFunction, LocalDofVector &localDofVector ) const
75 {
76 apply( localFunction, localDofVector );
77 }
78
80 template< class LocalFunction, class LocalDofVector >
81 void apply ( const LocalFunction &localFunction, LocalDofVector &localDofVector ) const
82 {
83 // use local functions range type here in case those differ
84 typename LocalFunction::RangeType value;
85 LocalAverage< LocalFunction, GridPartType >::apply( localFunction, value );
86 for( int i = 0; i < Range::dimension; ++i )
87 localDofVector[ i ] = value[ i ];
88 }
89
92 private:
93 //const EntityType &entity () const { return entity_.get(); }
94
95 //std::reference_wrapper< const EntityType > entity_;
96 };
97
98 } // namespace Fem
99
100} // namespace Dune
101
102#endif // #ifndef DUNE_FEM_SPACE_FINITEVOLUME_INTERPOLATION_HH
FunctionSpaceType::RangeType RangeType
type of range vectors, i.e., type of function values
Definition: localfunction.hh:107
Dune namespace.
Definition: alignedallocator.hh:13
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Jul 27, 22:29, 2024)