Derivative.hpp 2.1 KB
 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 ``````#pragma once #include #include #include #include namespace AMDiS { /// The derivative of a localfunction as localfunction itself template ::value), class = void_t().makeDerivative(std::declval()))> > auto derivative(LocalFunction const& lf, Type const& type) { return lf.makeDerivative(type); } namespace Concepts { /** \addtogroup Concepts * @{ **/ namespace Definition { struct HasDerivative { template `````` Praetorius, Simon committed Dec 16, 2019 31 `````` auto require(F&& f, T&& t) -> decltype( derivative(f,t) ); `````` 32 33 34 35 36 `````` }; struct HasLocalFunctionDerivative { template `````` Praetorius, Simon committed Dec 16, 2019 37 `````` auto require(F&& f, T&& t) -> decltype( derivative(localFunction(f),t) ); `````` 38 39 40 41 42 `````` }; struct HasPartial { template `````` Praetorius, Simon committed Dec 16, 2019 43 `````` auto require(F&& f, I&& i) -> decltype( partial(f, i) ); `````` 44 45 46 47 48 49 50 51 52 `````` }; } // end namespace Definition /// \brief GridFunction GF has free function `derivative(F)` template constexpr bool HasDerivative = models; `````` Praetorius, Simon committed Dec 16, 2019 53 54 55 56 `````` template using HasDerivative_t = models_t; `````` 57 58 59 60 `````` /// \brief GridFunction GF has free function `derivative(localFunction(F))` template constexpr bool HasLocalFunctionDerivative = models; `````` Praetorius, Simon committed Dec 16, 2019 61 62 63 64 `````` template using HasLocalFunctionDerivative_t = models_t; `````` 65 66 67 68 `````` /// \brief Functor F has free function `partial(F,_0)` template constexpr bool HasPartial = models)>; `````` Praetorius, Simon committed Dec 16, 2019 69 70 71 `````` template using HasPartial_t = models_t)>; `````` 72 73 74 75 76 `````` /** @} **/ } // end namespace Concepts } // end namespace AMDiS``````