dune-fem  2.4.1-rc
common/interpolation.hh
Go to the documentation of this file.
1 #ifndef DUNE_FEM_SPACE_INTERPOLATION_HH
2 #define DUNE_FEM_SPACE_INTERPOLATION_HH
3 
5 
6 #warning "<dune/fem/space/common/interpolation.hh> is deprecated. Use <dune/fem/space/common/interpolate.hh> instead."
7 #warning "Replace 'Dune::Fem::Interpolation< DiscreteFunction >::apply( u, v )' by 'interpolate( u, v )'."
8 
9 namespace Dune
10 {
11 
12  namespace Fem
13  {
14 
15  // Interpolation
16  // -------------
17 
38  template< class DiscreteFunction,
39  class IteratorProvider = Fem::IteratorProvider< typename DiscreteFunction::DiscreteFunctionSpaceType > >
41  {
42  typedef DiscreteFunction DiscreteFunctionType;
43  typedef typename DiscreteFunctionType::DiscreteFunctionSpaceType DiscreteFunctionSpaceType;
44 
50  template< class GridFunction >
51  void operator() ( const GridFunction &u, DiscreteFunctionType &v )
52  {
53  apply( u, v );
54  }
55 
61  template< class GridFunction >
62  static void apply ( const GridFunction &u, DiscreteFunctionType &v )
63  {
64  typedef typename IteratorProvider::IteratorType IteratorType;
65  typedef typename DiscreteFunctionSpaceType::EntityType EntityType;
66  typedef typename DiscreteFunctionType::LocalFunctionType LocalFunctionType;
67 
68  const DiscreteFunctionSpaceType &space = v.space();
69  IteratorProvider iteratorProvider( space );
70 
71  const IteratorType end = iteratorProvider.end();
72  for( IteratorType it = iteratorProvider.begin(); it != end; ++it )
73  {
74  const EntityType &entity = *it;
75  const auto interpolation = space.interpolation( entity );
76 
77  LocalFunctionType vLocal = v.localFunction( entity );
78  interpolation( u.localFunction( entity ), vLocal.localDofVector() );
79  }
80  }
81  };
82 
83  } // namespace Fem
84 
85 } // namespace Dune
86 
87 #endif // #ifndef DUNE_FEM_SPACE_INTERPOLATION_HH
IteratorType end() const
Definition: iteratorprovider.hh:27
DiscreteFunction DiscreteFunctionType
Definition: common/interpolation.hh:42
native interpolation of a discrete function space
Definition: common/interpolation.hh:40
DiscreteFunctionSpace::IteratorType IteratorType
Definition: iteratorprovider.hh:20
Definition: coordinate.hh:4
DiscreteFunctionType::DiscreteFunctionSpaceType DiscreteFunctionSpaceType
Definition: common/interpolation.hh:43
void operator()(const GridFunction &u, DiscreteFunctionType &v)
interpolate a grid function
Definition: common/interpolation.hh:51
static void apply(const GridFunction &u, DiscreteFunctionType &v)
interpolate a grid function
Definition: common/interpolation.hh:62
IteratorType begin() const
Definition: iteratorprovider.hh:26