AMDiS  0.3
The Adaptive Multi-Dimensional Simulation Toolbox
FunctionFromCallable.hpp
1 #pragma once
2 
3 #include <dune/common/version.hh>
4 
5 #include <dune/common/typeutilities.hh>
6 #include <dune/functions/common/functionfromcallable.hh>
7 
8 namespace AMDiS
9 {
10  namespace Impl
11  {
12  template <class Traits, class F,
13  class Range = typename Traits::RangeType,
14  class Domain = typename Traits::DomainType>
15  auto functionFromCallableImpl(F const& f, Dune::PriorityTag<2>)
16  {
17  return Dune::Functions::FunctionFromCallable<Range(Domain), F>(f);
18  }
19 
20  template <class Signature, class F>
21  auto functionFromCallableImpl(F const& f, Dune::PriorityTag<1>)
22  {
23  return Dune::Functions::FunctionFromCallable<Signature, F>(f);
24  }
25  }
26 
27  template <class SigTraits, class F>
28  auto functionFromCallable(F const& f)
29  {
30  return Impl::functionFromCallableImpl<SigTraits>(f, Dune::PriorityTag<10>{});
31  }
32 
33 } // end namespace AMDiS
Definition: AdaptBase.hpp:6