1#ifndef DUNE_FEM_SPACE_COMMON_LOCALINTERPOLATION_HH
2#define DUNE_FEM_SPACE_COMMON_LOCALINTERPOLATION_HH
6#include <dune/fem/common/bindguard.hh>
17 template<
class DiscreteFunctionSpace >
18 class LocalInterpolation;
20 template <
class DiscreteFunctionSpace >
21 class LocalInterpolation
24 LocalInterpolation(
const LocalInterpolation& ) =
delete;
28 typedef typename DiscreteFunctionSpaceType :: InterpolationType InterpolationType;
31 typedef typename DiscreteFunctionSpaceType :: EntityType EntityType;
33 LocalInterpolation(
const DiscreteFunctionSpaceType& space )
34 : interpolation_( space.interpolation() )
43 void bind (
const EntityType& entity )
45 interpolation_.bind( entity );
53 interpolation_.unbind();
61 template<
class LocalFunction,
class LocalDofVector >
62 void operator () (
const LocalFunction &localFunction, LocalDofVector &dofs )
const
64 interpolation_( localFunction, dofs );
68 InterpolationType interpolation_;
72 template<
class DiscreteFunctionSpace >
73 class LocalInterpolationWrapper
75 typedef typename DiscreteFunctionSpace :: InterpolationImplType
76 InterpolationImplType;
79 typedef typename DiscreteFunctionSpace::EntityType EntityType;
86 void bind(
const EntityType& entity )
88 interpolation_.emplace( space_.localInterpolation( entity ) );
93 interpolation().unbind();
97 template<
class LocalFunction,
class LocalDofVector >
98 void operator () (
const LocalFunction &localFunction, LocalDofVector &dofs )
const
100 interpolation()( localFunction, dofs );
104 const InterpolationImplType& interpolation()
const
106 assert( interpolation_.has_value() );
107 return *interpolation_;
109 InterpolationImplType& interpolation()
111 assert( interpolation_.has_value() );
112 return *interpolation_;
116 std::optional< InterpolationImplType > interpolation_;
Dune namespace.
Definition: alignedallocator.hh:13