dune-fem 2.12-git
Loading...
Searching...
No Matches
finitevolume/interpolation.hh
Go to the documentation of this file.
1#ifndef DUNE_FEM_SPACE_FINITEVOLUME_INTERPOLATION_HH
2#define DUNE_FEM_SPACE_FINITEVOLUME_INTERPOLATION_HH
3
4#include <functional>
5
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 >
21 {
23
24 public:
26 typedef GridPart GridPartType;
28 typedef typename GridPartType::template Codim< 0 >::EntityType EntityType;
29
32
38
39 void bind( const EntityType &entity ) {}
40 void unbind() {}
41
42 explicit FiniteVolumeLocalInterpolation ( const EntityType &entity )
43 { bind(entity); }
44
52
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;
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
virtual void operator()()=0
static GridFunctionView< GF > localFunction(const GF &gf)
Definition gridfunctionview.hh:118
static void apply(const LocalFunction &localFunction, typename LocalFunction::RangeType &average)
Definition average.hh:143
interface for local functions
Definition localfunction.hh:77
FunctionSpaceType::RangeType RangeType
type of range vectors, i.e., type of function values
Definition localfunction.hh:110
Definition finitevolume/basisfunctionset.hh:28
Definition finitevolume/interpolation.hh:21
FiniteVolumeLocalInterpolation & operator=(const ThisType &)=default
GridPartType::template Codim< 0 >::EntityType EntityType
entity type
Definition finitevolume/interpolation.hh:28
void apply(const LocalFunction &localFunction, LocalDofVector &localDofVector) const
interpolate local function
Definition finitevolume/interpolation.hh:78
FiniteVolumeLocalInterpolation(const ThisType &)=default
FiniteVolumeBasisFunctionSet< EntityType, Range > BasisFunctionSetType
basis function set type
Definition finitevolume/interpolation.hh:31
void bind(const EntityType &entity)
Definition finitevolume/interpolation.hh:39
void unbind()
Definition finitevolume/interpolation.hh:40
FiniteVolumeLocalInterpolation()
Definition finitevolume/interpolation.hh:37
GridPart GridPartType
grid part type
Definition finitevolume/interpolation.hh:26
FiniteVolumeLocalInterpolation(const EntityType &entity)
Definition finitevolume/interpolation.hh:42