5 #include <amdis/common/Concepts.hpp> 6 #include <amdis/common/DerivativeTraits.hpp> 7 #include <amdis/common/Index.hpp> 12 template <
class LocalFunction,
class Type,
13 REQUIRES(std::is_convertible_v<tag::derivative_type, Type>)>
14 auto derivativeOf(LocalFunction
const& lf, Type
const& type)
15 -> decltype(lf.makeDerivative(type))
17 return lf.makeDerivative(type);
22 template <
class LocalFunction>
23 auto derivative(LocalFunction
const& lf)
24 -> decltype(lf.makeDerivative(tag::gradient{}))
26 return lf.makeDerivative(tag::gradient{});
40 template <
class F,
class T>
41 auto require(F&& f, T&& t) -> decltype( derivativeOf(f,t) );
46 template <
class F,
class T>
47 auto require(F&& f, T&& t) -> decltype( derivativeOf(localFunction(f),t) );
52 template <
class F,
class I>
53 auto require(F&& f, I&& i) -> decltype( partial(f, i) );
60 template <
class GF,
class Type>
61 constexpr
bool HasDerivative = models<Definition::HasDerivative(GF,Type)>;
63 template <
class GF,
class Type>
64 using HasDerivative_t = models_t<Definition::HasDerivative(GF,Type)>;
68 template <
class GF,
class Type>
71 template <
class GF,
class Type>
72 using HasLocalFunctionDerivative_t = models_t<Definition::HasLocalFunctionDerivative(GF,Type)>;
77 constexpr
bool HasPartial = models<Definition::HasPartial(F,index_t<0>)>;
80 using HasPartial_t = models_t<Definition::HasPartial(F,index_t<0>)>;
Definition: Derivative.hpp:44
constexpr bool HasPartial
Functor F has free function partial(F,_0)
Definition: Derivative.hpp:77
Definition: AdaptBase.hpp:6
constexpr bool HasLocalFunctionDerivative
GridFunction GF has free function derivativeOf(localFunction(F))
Definition: Derivative.hpp:69
Definition: Derivative.hpp:38
Definition: Derivative.hpp:50
constexpr bool HasDerivative
GridFunction GF has free function derivativeOf(F,type)
Definition: Derivative.hpp:61