dune-fem  2.8-git
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 
10 namespace 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  /*
43  explicit FiniteVolumeLocalInterpolation ( const EntityType &entity )
44  : entity_( entity )
45  {}
46  */
47 
55 
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  Range value;
85  for( int i = 0; i < Range::dimension; ++i )
86  localDofVector[ i ] = value[ i ];
87  }
88 
91  private:
92  //const EntityType &entity () const { return entity_.get(); }
93 
94  //std::reference_wrapper< const EntityType > entity_;
95  };
96 
97  } // namespace Fem
98 
99 } // namespace Dune
100 
101 #endif // #ifndef DUNE_FEM_SPACE_FINITEVOLUME_INTERPOLATION_HH
Definition: bindguard.hh:11
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
Definition: finitevolume/basisfunctionset.hh:26
Definition: finitevolume/interpolation.hh:21
void apply(const LocalFunction &localFunction, LocalDofVector &localDofVector) const
interpolate local function
Definition: finitevolume/interpolation.hh:81
GridPartType::template Codim< 0 >::EntityType EntityType
entity type
Definition: finitevolume/interpolation.hh:28
void operator()(const LocalFunction &localFunction, LocalDofVector &localDofVector) const
return basis function set
Definition: finitevolume/interpolation.hh:74
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 & operator=(const ThisType &)=default