Tags.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <cmath>
7 #include <string>
8 
10 #include "Time/Tags.hpp"
11 #include "Utilities/TMPL.hpp"
13 
14 namespace Initialization {
15 /// \ingroup InitializationGroup
16 /// \brief %Tags used during initialization of parallel components.
17 namespace Tags {
19  static std::string name() noexcept { return "InitialTime"; }
20  using type = double;
21  using option_tags = tmpl::list<OptionTags::InitialTime>;
22 
23  static double create_from_options(const double initial_time) noexcept {
24  return initial_time;
25  }
26 };
27 
29  static std::string name() noexcept { return "InitialTimeDelta"; }
30  using type = double;
31  using option_tags = tmpl::list<OptionTags::InitialTimeStep>;
32 
33  static double create_from_options(const double initial_time_step) noexcept {
34  return initial_time_step;
35  }
36 };
37 
38 template <bool UsingLocalTimeStepping>
40  static std::string name() noexcept { return "InitialSlabSize"; }
41  using type = double;
42  using option_tags = tmpl::list<OptionTags::InitialSlabSize>;
43 
44  static double create_from_options(const double initial_slab_size) noexcept {
45  return initial_slab_size;
46  }
47 };
48 
49 template <>
50 struct InitialSlabSize<false> : db::SimpleTag {
51  static std::string name() noexcept { return "InitialSlabSize"; }
52  using type = double;
53  using option_tags = tmpl::list<OptionTags::InitialTimeStep>;
54 
55  static double create_from_options(const double initial_time_step) noexcept {
56  return std::abs(initial_time_step);
57  }
58 };
59 } // namespace Tags
60 } // namespace Initialization
Defines class tuples::TaggedTuple.
Definition: ConservativeSystem.hpp:34
Tags for the DataBox inherit from this type.
Definition: DataBoxTag.hpp:64
Definition: DataBoxTag.hpp:29
Wraps the template metaprogramming library used (brigand)
Defines classes SimpleTag, PrefixTag, ComputeTag and several functions for retrieving tag info...
Definition: Tags.hpp:18
Defines tags related to Time quantities.