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/CreateIsCallable.hpp"
15 #include "Utilities/TypeTraits/IsCallable.hpp"
16 
17 namespace domain {
18 /// Check if the calls to the coordinate map and its inverse map are
19 /// time-dependent
20 template <typename T>
21 using is_map_time_dependent_t = tt::is_callable_t<
25 
26 /// Check if the calls to the coordinate map and its inverse map are
27 /// time-dependent
28 template <typename T>
29 constexpr bool is_map_time_dependent_v = is_map_time_dependent_t<T>::value;
30 
31 namespace detail {
32 CREATE_IS_CALLABLE(jacobian)
33 } // namespace detail
34 
35 /// Check if the calls to the Jacobian and inverse Jacobian of the coordinate
36 /// map are time-dependent
37 template <typename Map, typename T>
38 using is_jacobian_time_dependent_t = detail::is_jacobian_callable_t<
39  Map, std::array<std::decay_t<T>, std::decay_t<Map>::dim>, double,
41  std::string, std::unique_ptr<domain::FunctionsOfTime::FunctionOfTime>>>;
42 
43 /// Check if the calls to the Jacobian and inverse Jacobian of the coordinate
44 /// map are time-dependent
45 template <typename Map, typename T>
46 constexpr bool is_jacobian_time_dependent_v =
47  is_jacobian_time_dependent_t<Map, T>::value;
48 } // 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: CreateIsCallable.hpp:32
Definition: BlockId.hpp:16
typename is_callable< T, Args... >::type is_callable_t
Definition: IsCallable.hpp:73
Definition: Determinant.hpp:11