dune-fem 2.12-git
Loading...
Searching...
No Matches
common/localinterpolation.hh
Go to the documentation of this file.
1#ifndef DUNE_FEM_SPACE_COMMON_LOCALINTERPOLATION_HH
2#define DUNE_FEM_SPACE_COMMON_LOCALINTERPOLATION_HH
3
4#include <optional>
5#include <cassert>
6
8
9namespace Dune
10{
11
12 namespace Fem
13 {
14
15 // Forward Declarations
16 // --------------------
17
18 template< class DiscreteFunctionSpace >
19 class LocalInterpolation;
20
21 template < class DiscreteFunctionSpace >
23 {
24 // do not copy this class
25 LocalInterpolation( const LocalInterpolation& ) = delete;
27
28 protected:
29 typedef typename DiscreteFunctionSpaceType :: InterpolationType InterpolationType;
30
31 public:
32 typedef typename DiscreteFunctionSpaceType :: EntityType EntityType;
33
35 : interpolation_( space.interpolation() )
36 {}
37
44 void bind ( const EntityType& entity )
45 {
46 interpolation_.bind( entity );
47 }
48
52 void unbind ()
53 {
54 interpolation_.unbind();
55 }
56
62 template< class LocalFunction, class LocalDofVector >
63 void operator () ( const LocalFunction &localFunction, LocalDofVector &dofs ) const
64 {
66 }
67
68 protected:
70 };
71
72
73 template< class DiscreteFunctionSpace >
75 {
76 typedef typename DiscreteFunctionSpace :: InterpolationImplType
77 InterpolationImplType;
78
79 public:
80 typedef typename DiscreteFunctionSpace::EntityType EntityType;
81
83 : space_( space )
85 {}
86
87 void bind( const EntityType& entity )
88 {
89 interpolation_.emplace( space_.localInterpolation( entity ) );
90 }
91
92 void unbind()
93 {
94 interpolation().unbind();
95 }
96
98 template< class LocalFunction, class LocalDofVector >
99 void operator () ( const LocalFunction &localFunction, LocalDofVector &dofs ) const
100 {
102 }
103
104 protected:
105 const InterpolationImplType& interpolation() const
106 {
107 assert( interpolation_.has_value() );
108 return *interpolation_;
109 }
110 InterpolationImplType& interpolation()
111 {
112 assert( interpolation_.has_value() );
113 return *interpolation_;
114 }
115
118 };
119
120
121 } // namespace Fem
122
123} // namespace Dune
124
125#endif // #ifndef DUNE_FEM_SPACE_COMMON_LOCALINTERPOLATION_HH
virtual void operator()()=0
static GridFunctionView< GF > localFunction(const GF &gf)
Definition gridfunctionview.hh:118
IteratorRange< typename DF::DofIteratorType > dofs(DF &df)
Iterates over all DOFs.
Definition rangegenerators.hh:76
interface for local functions
Definition localfunction.hh:77
Definition common/localinterpolation.hh:23
DiscreteFunctionSpaceType::InterpolationType InterpolationType
Definition common/localinterpolation.hh:29
void unbind()
clears the local interpolation by removing the basisFunctionSet
Definition common/localinterpolation.hh:52
void bind(const EntityType &entity)
initialize the local interpolation for an entity
Definition common/localinterpolation.hh:44
LocalInterpolation(const DiscreteFunctionSpaceType &space)
Definition common/localinterpolation.hh:34
InterpolationType interpolation_
Definition common/localinterpolation.hh:69
DiscreteFunctionSpaceType::EntityType EntityType
Definition common/localinterpolation.hh:32
Definition common/localinterpolation.hh:75
DiscreteFunctionSpace::EntityType EntityType
Definition common/localinterpolation.hh:80
void unbind()
Definition common/localinterpolation.hh:92
const InterpolationImplType & interpolation() const
Definition common/localinterpolation.hh:105
void bind(const EntityType &entity)
Definition common/localinterpolation.hh:87
LocalInterpolationWrapper(const DiscreteFunctionSpace &space)
Definition common/localinterpolation.hh:82
const DiscreteFunctionSpace & space_
Definition common/localinterpolation.hh:116
std::optional< InterpolationImplType > interpolation_
Definition common/localinterpolation.hh:117
InterpolationImplType & interpolation()
Definition common/localinterpolation.hh:110
discrete function space
T emplace(T... args)
T has_value(T... args)