Metavariables.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 domain::protocols {
9 /*!
10  * \brief Compile-time options for a Domain.
11  *
12  * A class conforming to this protocol is placed in the metavariables to choose
13  * compile-time options for creating domains. The conforming class must provide
14  * the following static member variables:
15  * - `bool enable_time_dependent_maps`: Whether or not domains may have
16  * time-dependent maps. When set to `true` domain creators may require
17  * additional input-file options related to the time dependence. When set to
18  * `false` the domains are static, e.g. for elliptic problems.
19  *
20  * Here is an example of a class that conforms to this protocol:
21  *
22  * \snippet Domain/Test_Protocols.cpp domain_metavariables_example
23  *
24  */
25 struct Metavariables {
26  template <typename ConformingType>
27  struct test {
28  using enable_time_dependent_maps_type = const bool;
29  using enable_time_dependent_maps_return_type =
30  decltype(ConformingType::enable_time_dependent_maps);
31  static_assert(std::is_same_v<enable_time_dependent_maps_type,
32  enable_time_dependent_maps_return_type>,
33  "The metavariable 'enable_time_dependent_maps' should be a "
34  "static constexpr bool.");
35  };
36 };
37 } // namespace domain::protocols
domain::protocols::Metavariables
Compile-time options for a Domain.
Definition: Metavariables.hpp:25
domain::protocols::Metavariables::test
Definition: Metavariables.hpp:27
type_traits