dune-functions  2.7.1
gridfunction_imp.hh
Go to the documentation of this file.
1 // -*- tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
2 // vi: set et ts=4 sw=2 sts=2:
3 #ifndef DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_IMP_HH
4 #define DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_IMP_HH
5 
9 
10 
11 
12 namespace Dune {
13 namespace Functions {
14 namespace Imp {
15 
19 struct HasFreeLocalFunction
20 {
21  template<class F>
22  auto require(F&& f) -> decltype(
23  localFunction(f)
24  );
25 };
26 
27 
28 
29 // Interface of type erasure wrapper
30 //
31 // Notice that the basic interface of polymorphic classes (destructor, clone, ...)
32 // will be added by the type erasure foundation classes.
33 template<class Signature, class DerivativeInterface, class LocalFunctionInterface, class EntitySet>
34 class GridFunctionWrapperInterface :
35  public DifferentiableFunctionWrapperInterface<Signature, DerivativeInterface>
36 {
37 public:
38  virtual LocalFunctionInterface wrappedLocalFunction() const = 0;
39 
40  virtual const EntitySet& wrappedEntitySet() const = 0;
41 };
42 
43 
44 // Implementation of type erasure wrapper
45 template<class Signature, class DerivativeInterface, class LocalFunctionInterface, class EntitySet, class B>
46 class GridFunctionWrapperImplementation :
47  public DifferentiableFunctionWrapperImplementation<Signature, DerivativeInterface, B>
48 {
49  using Base = DifferentiableFunctionWrapperImplementation<Signature, DerivativeInterface, B>;
50 public:
51  using Base::Base;
52 
53  virtual LocalFunctionInterface wrappedLocalFunction() const
54  {
55  return localFunction(this->get());
56  }
57 
58  virtual const EntitySet& wrappedEntitySet() const
59  {
60  return this->get().entitySet();
61  }
62 };
63 
64 
65 
66 }}} // namespace Dune::Functions::Imp
67 
68 
69 
70 #endif // DUNE_FUNCTIONS_GRIDFUNCTIONS_GRID_FUNCTION_IMP_HH
void localFunction(DiscreteGlobalBasisFunction< TT... > &&t)=delete
Construction of local functions from a temporary DiscreteGlobalBasisFunction (forbidden)
Definition: polynomial.hh:10