UsingSubcell.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <type_traits>
7 
8 namespace evolution::dg {
9 /*!
10  * \brief If `Metavars` has a `SubcellOptions` member struct and
11  * `SubcellOptions::subcell_enabled` is `true` then inherits from
12  * `std::true_type`, otherwise inherits from `std::false_type`.
13  *
14  * \note This check is intentionally not inside the `DgSubcell` library so that
15  * executables that do not use subcell do not need to link against it.
16  */
17 template <typename Metavars, typename = std::void_t<>>
19 
20 /// \cond
21 template <typename Metavars>
22 struct using_subcell<Metavars, std::void_t<typename Metavars::SubcellOptions>>
23  : std::bool_constant<Metavars::SubcellOptions::subcell_enabled> {};
24 /// \endcond
25 
26 /*!
27  * \brief If `Metavars` has a `SubcellOptions` member struct and
28  * `SubcellOptions::subcell_enabled` is `true` then is `true`, otherwise
29  * `false`.
30  *
31  * \note This check is intentionally not inside the `DgSubcell` library so that
32  * executables that do not use subcell do not need to link against it.
33  */
34 template <typename Metavars>
36 } // namespace evolution::dg
std::false_type
evolution::dg::using_subcell_v
constexpr bool using_subcell_v
If Metavars has a SubcellOptions member struct and SubcellOptions::subcell_enabled is true then is tr...
Definition: UsingSubcell.hpp:35
evolution::dg
Functionality for evolving hyperbolic partial differential equations using the discontinuous Galerkin...
Definition: ConservativeDuDt.hpp:22
evolution::dg::using_subcell
If Metavars has a SubcellOptions member struct and SubcellOptions::subcell_enabled is true then inher...
Definition: UsingSubcell.hpp:18
type_traits