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