1#ifndef DUNE_FEM_SPACE_COMMON_LOCALINTERPOLATION_HH
2#define DUNE_FEM_SPACE_COMMON_LOCALINTERPOLATION_HH
7#include <dune/fem/common/bindguard.hh>
18 template<
class DiscreteFunctionSpace >
19 class LocalInterpolation;
21 template <
class DiscreteFunctionSpace >
22 class LocalInterpolation
25 LocalInterpolation(
const LocalInterpolation& ) =
delete;
29 typedef typename DiscreteFunctionSpaceType :: InterpolationType InterpolationType;
32 typedef typename DiscreteFunctionSpaceType :: EntityType EntityType;
34 LocalInterpolation(
const DiscreteFunctionSpaceType& space )
35 : interpolation_( space.interpolation() )
44 void bind (
const EntityType& entity )
46 interpolation_.bind( entity );
54 interpolation_.unbind();
62 template<
class LocalFunction,
class LocalDofVector >
63 void operator () (
const LocalFunction &localFunction, LocalDofVector &dofs )
const
65 interpolation_( localFunction, dofs );
69 InterpolationType interpolation_;
73 template<
class DiscreteFunctionSpace >
74 class LocalInterpolationWrapper
76 typedef typename DiscreteFunctionSpace :: InterpolationImplType
77 InterpolationImplType;
80 typedef typename DiscreteFunctionSpace::EntityType EntityType;
87 void bind(
const EntityType& entity )
89 interpolation_.emplace( space_.localInterpolation( entity ) );
94 interpolation().unbind();
98 template<
class LocalFunction,
class LocalDofVector >
99 void operator () (
const LocalFunction &localFunction, LocalDofVector &dofs )
const
101 interpolation()( localFunction, dofs );
105 const InterpolationImplType& interpolation()
const
107 assert( interpolation_.has_value() );
108 return *interpolation_;
110 InterpolationImplType& interpolation()
112 assert( interpolation_.has_value() );
113 return *interpolation_;
117 std::optional< InterpolationImplType > interpolation_;
Dune namespace.
Definition: alignedallocator.hh:13