Line data Source code
1 0 : // Distributed under the MIT License.
2 : // See LICENSE.txt for details.
3 :
4 : #pragma once
5 :
6 : #include <type_traits>
7 :
8 : #include "Utilities/TMPL.hpp"
9 :
10 : namespace elliptic {
11 : namespace detail {
12 : template <typename System, typename = std::void_t<>>
13 : struct fluxes_computer_linearized {
14 : using type = typename System::fluxes_computer;
15 : };
16 : template <typename System>
17 : struct fluxes_computer_linearized<
18 : System, std::void_t<typename System::fluxes_computer_linearized>> {
19 : using type = typename System::fluxes_computer_linearized;
20 : };
21 : } // namespace detail
22 :
23 : /// The `System::fluxes_computer` or the `System::fluxes_computer_linearized`,
24 : /// depending on the `Linearized` parameter. If the system has no
25 : /// `fluxes_computer_linearized` alias it is assumed that the linear flux is
26 : /// functionally identical to the non-linear flux, so the
27 : /// `System::fluxes_computer` is returned either way.
28 : template <typename System, bool Linearized>
29 1 : using get_fluxes_computer = tmpl::conditional_t<
30 : Linearized, typename detail::fluxes_computer_linearized<System>::type,
31 : typename System::fluxes_computer>;
32 :
33 : /// The `argument_tags` of either the `System::fluxes_computer` or the
34 : /// `System::fluxes_computer_linearized`, depending on the `Linearized`
35 : /// parameter.
36 : template <typename System, bool Linearized>
37 1 : using get_fluxes_argument_tags =
38 : typename get_fluxes_computer<System, Linearized>::argument_tags;
39 :
40 : /// The `volume_tags` of either the `System::fluxes_computer` or the
41 : /// `System::fluxes_computer_linearized`, depending on the `Linearized`
42 : /// parameter.
43 : template <typename System, bool Linearized>
44 1 : using get_fluxes_volume_tags =
45 : typename get_fluxes_computer<System, Linearized>::volume_tags;
46 :
47 : /// The `const_global_cache_tags` of either the `System::fluxes_computer` or the
48 : /// `System::fluxes_computer_linearized`, depending on the `Linearized`
49 : /// parameter.
50 : template <typename System, bool Linearized>
51 1 : using get_fluxes_const_global_cache_tags =
52 : typename get_fluxes_computer<System, Linearized>::const_global_cache_tags;
53 : } // namespace elliptic
|