DhGaugeParameters.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <array>
7 #include <string>
8 
9 #include "Options/Options.hpp"
10 
11 /// \cond
12 namespace PUP {
13 class er;
14 } // namespace PUP
15 /// \endcond
16 
18 /*!
19  * \brief A struct holding the parameters for initializing damped harmonic gauge
20  *
21  * If UseRollon is true, the gauge transitions ("rolls on") to damped
22  * harmonic from the initial data gauge; otherwise, the gauge begins
23  * immediately in damped harmonic gauge.
24  */
25 template <bool UseRollon>
27 
28 /// \cond
29 template <>
30 struct DhGaugeParameters<true> {
31  double rollon_start;
32  double rollon_window;
33  double spatial_decay_width;
34  std::array<double, 3> amplitudes;
35  std::array<int, 3> exponents;
36 
37  static constexpr Options::String help{
38  "A struct holding the parameters for initializing damped harmonic "
39  "gauge, including a roll-on from the initial gauge."};
40 
41  /// The rollon start time
42  struct RollOnStartTime {
43  using type = double;
44  static constexpr Options::String help{
45  "Simulation time to start rolling on the damped harmonic gauge"};
46  };
47 
48  /// The width of the Gaussian for the gauge rollon
49  struct RollOnTimeWindow {
50  using type = double;
51  static constexpr Options::String help{
52  "The width of the Gaussian that controls how quickly the gauge is "
53  "rolled on."};
54  };
55 
56  /// The width of the Gaussian for the spatial decay of the damped harmonic
57  /// gauge.
58  struct SpatialDecayWidth {
59  using type = double;
60  static constexpr Options::String help{
61  "Spatial width of weight function used in the damped harmonic "
62  "gauge."};
63  };
64 
65  /// The amplitudes for the L1, L2, and S terms, respectively, for the damped
66  /// harmonic gauge.
67  struct Amplitudes {
68  using type = std::array<double, 3>;
69  static constexpr Options::String help{
70  "Amplitudes [AL1, AL2, AS] for the damped harmonic gauge."};
71  };
72 
73  /// The exponents for the L1, L2, and S terms, respectively, for the damped
74  /// harmonic gauge.
75  struct Exponents {
76  using type = std::array<int, 3>;
77  static constexpr Options::String help{
78  "Exponents [eL1, eL2, eS] for the damped harmonic gauge."};
79  };
80 
81  using options = tmpl::list<RollOnStartTime, RollOnTimeWindow,
82  SpatialDecayWidth, Amplitudes, Exponents>;
83 
84  DhGaugeParameters(double start, double window, double width,
85  const std::array<double, 3>& amps,
86  const std::array<int, 3>& exps);
87 
88  DhGaugeParameters() = default;
89 
90  // clang-tidy: google-runtime-references
91  void pup(PUP::er& p) noexcept; // NOLINT
92 };
93 
94 template <>
95 struct DhGaugeParameters<false> {
96  double spatial_decay_width;
97  std::array<double, 3> amplitudes;
98  std::array<int, 3> exponents;
99 
100  static constexpr Options::String help{
101  "A struct holding the parameters for initializing damped harmonic "
102  "gauge with no roll-on from the initial gauge."};
103 
104  /// The width of the Gaussian for the spatial decay of the damped harmonic
105  /// gauge.
106  struct SpatialDecayWidth {
107  using type = double;
108  static constexpr Options::String help{
109  "Spatial width of weight function used in the damped harmonic "
110  "gauge."};
111  };
112 
113  /// The amplitudes for the L1, L2, and S terms, respectively, for the damped
114  /// harmonic gauge.
115  struct Amplitudes {
116  using type = std::array<double, 3>;
117  static constexpr Options::String help{
118  "Amplitudes [AL1, AL2, AS] for the damped harmonic gauge."};
119  };
120 
121  /// The exponents for the L1, L2, and S terms, respectively, for the damped
122  /// harmonic gauge.
123  struct Exponents {
124  using type = std::array<int, 3>;
125  static constexpr Options::String help{
126  "Exponents [eL1, eL2, eS] for the damped harmonic gauge."};
127  };
128 
129  using options = tmpl::list<SpatialDecayWidth, Amplitudes, Exponents>;
130 
131  DhGaugeParameters(double width, const std::array<double, 3>& amps,
132  const std::array<int, 3>& exps);
133 
134  DhGaugeParameters() = default;
135 
136  // clang-tidy: google-runtime-references
137  void pup(PUP::er& p) noexcept; // NOLINT
138 };
139 /// \endcond
140 } // namespace GeneralizedHarmonic::gauges
Options.hpp
GeneralizedHarmonic::gauges::DhGaugeParameters
A struct holding the parameters for initializing damped harmonic gauge.
Definition: DhGaugeParameters.hpp:26
array
Options::String
const char *const String
The string used in option structs.
Definition: Options.hpp:32
GeneralizedHarmonic::gauges
Gauge conditions for generalized harmonic evolution systems.
Definition: DampedHarmonic.hpp:27
string