Line data Source code
1 0 : // 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 1 : using is_map_time_dependent_t = tt::is_callable_t<
22 : T, std::array<std::decay_t<T>, std::decay_t<T>::dim>, double,
23 : std::unordered_map<
24 : std::string, std::unique_ptr<domain::FunctionsOfTime::FunctionOfTime>>>;
25 :
26 : /// Check if the calls to the coordinate map and its inverse map are
27 : /// time-dependent
28 : template <typename T>
29 1 : constexpr bool is_map_time_dependent_v = is_map_time_dependent_t<T>::value;
30 :
31 : /// @{
32 : /// Check if the calls to the coordinate map and its inverse map are
33 : /// time-dependent
34 : template <typename T>
35 : concept TimeDependentMap = is_map_time_dependent_v<T>;
36 : template <typename T>
37 : concept TimeIndependentMap = not is_map_time_dependent_v<T>;
38 : /// @}
39 :
40 : namespace detail {
41 : CREATE_IS_CALLABLE(jacobian)
42 : } // namespace detail
43 :
44 : /// Check if the calls to the Jacobian and inverse Jacobian of the coordinate
45 : /// map are time-dependent
46 : template <typename Map, typename T>
47 1 : using is_jacobian_time_dependent_t = detail::is_jacobian_callable_t<
48 : Map, std::array<std::decay_t<T>, std::decay_t<Map>::dim>, double,
49 : std::unordered_map<
50 : std::string, std::unique_ptr<domain::FunctionsOfTime::FunctionOfTime>>>;
51 :
52 : /// Check if the calls to the Jacobian and inverse Jacobian of the coordinate
53 : /// map are time-dependent
54 : template <typename Map, typename T>
55 1 : constexpr bool is_jacobian_time_dependent_v =
56 : is_jacobian_time_dependent_t<Map, T>::value;
57 : } // namespace domain
|