TimeDependentHelpers.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <array>
7 #include <cstddef>
8 #include <memory>
9 #include <string>
10 #include <type_traits>
11 #include <unordered_map>
12 
13 #include "Domain/FunctionsOfTime/FunctionOfTime.hpp"
14 #include "Utilities/TypeTraits.hpp"
15 
16 namespace domain {
17 /// Check if the calls to the coordinate map and its inverse map are
18 /// time-dependent
19 template <typename T>
20 using is_map_time_dependent_t = tt::is_callable_t<
24 
25 /// Check if the calls to the coordinate map and its inverse map are
26 /// time-dependent
27 template <typename T>
28 constexpr bool is_map_time_dependent_v = is_map_time_dependent_t<T>::value;
29 
30 namespace detail {
31 CREATE_IS_CALLABLE(jacobian)
32 } // namespace detail
33 
34 /// Check if the calls to the Jacobian and inverse Jacobian of the coordinate
35 /// map are time-dependent
36 template <typename Map, typename T>
37 using is_jacobian_time_dependent_t = detail::is_jacobian_callable_t<
38  Map, std::array<std::decay_t<T>, std::decay_t<Map>::dim>, double,
40  std::string, std::unique_ptr<domain::FunctionsOfTime::FunctionOfTime>>>;
41 
42 /// Check if the calls to the Jacobian and inverse Jacobian of the coordinate
43 /// map are time-dependent
44 template <typename Map, typename T>
45 constexpr bool is_jacobian_time_dependent_v =
46  is_jacobian_time_dependent_t<Map, T>::value;
47 } // namespace domain
#define CREATE_IS_CALLABLE(METHOD_NAME)
Generate a type trait to check if a class has a member function that can be invoked with arguments of...
Definition: TypeTraits.hpp:870
Definition: BlockId.hpp:16
typename is_callable< T, Args... >::type is_callable_t
Definition: TypeTraits.hpp:848
Definition: Determinant.hpp:11
Defines type traits, some of which are future STL type_traits header.