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 explicit FiniteVolumeLocalInterpolation ( const EntityType &entity )
43 { bind(entity); }
44
51 FiniteVolumeLocalInterpolation ( const ThisType & ) = default;
52
53 FiniteVolumeLocalInterpolation &operator= ( const ThisType & ) = default;
54
62 /*
63 BasisFunctionSetType basisFunctionSet () const
64 {
65 return BasisFunctionSetType( entity() );
66 }
67 */
68
70 template< class LocalFunction, class LocalDofVector >
71 void operator() ( const LocalFunction &localFunction, LocalDofVector &localDofVector ) const
72 {
73 apply( localFunction, localDofVector );
74 }
75
77 template< class LocalFunction, class LocalDofVector >
78 void apply ( const LocalFunction &localFunction, LocalDofVector &localDofVector ) const
79 {
80 // use local functions range type here in case those differ
81 typename LocalFunction::RangeType value;
82 LocalAverage< LocalFunction, GridPartType >::apply( localFunction, value );
83 for( int i = 0; i < Range::dimension; ++i )
84 localDofVector[ i ] = value[ i ];
85 }
86
89 private:
90 //const EntityType &entity () const { return entity_.get(); }
91
92 //std::reference_wrapper< const EntityType > entity_;
93 };
94
95 } // namespace Fem
96
97} // namespace Dune
98
99#endif // #ifndef DUNE_FEM_SPACE_FINITEVOLUME_INTERPOLATION_HH
FunctionSpaceType::RangeType RangeType
type of range vectors, i.e., type of function values
Definition: localfunction.hh:110
Dune namespace.
Definition: alignedallocator.hh:13
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Nov 21, 23:30, 2024)