OptionTags.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <cstddef>
7 #include <limits>
8 
9 #include "DataStructures/DataBox/Tag.hpp"
10 #include "Evolution/Systems/Cce/Initialize/InitializeJ.hpp"
11 #include "Evolution/Systems/Cce/InterfaceManagers/GhInterfaceManager.hpp"
12 #include "Evolution/Systems/Cce/InterfaceManagers/GhLockstep.hpp"
13 #include "Evolution/Systems/Cce/ReadBoundaryDataH5.hpp"
14 #include "NumericalAlgorithms/Interpolation/SpanInterpolator.hpp"
15 #include "Options/Options.hpp"
16 
17 namespace Cce {
18 namespace OptionTags {
19 
20 /// %Option group
21 struct Cce {
22  static constexpr OptionString help = {"Options for the Cce evolution system"};
23 };
24 
25 /// %Option group
26 struct Filtering {
27  static constexpr OptionString help = {"Options for the filtering in Cce"};
28  using group = Cce;
29 };
30 
31 struct LMax {
32  using type = size_t;
33  static constexpr OptionString help{
34  "Maximum l value for spin-weighted spherical harmonics"};
35  using group = Cce;
36 };
37 
38 struct FilterLMax {
39  using type = size_t;
40  static constexpr OptionString help{"l mode cutoff for angular filtering"};
41  using group = Filtering;
42 };
43 
45  using type = double;
46  static constexpr OptionString help{
47  "alpha parameter in exponential radial filter"};
48  using group = Filtering;
49 };
50 
52  using type = size_t;
53  static constexpr OptionString help{
54  "Half-power of the exponential radial filter argument"};
55  using group = Filtering;
56 };
57 
59  using type = size_t;
60  static constexpr OptionString help{"Maximum l value for swsh output"};
61  using group = Cce;
62 };
63 
65  using type = size_t;
66  static constexpr OptionString help{
67  "Number of radial grid points in the spherical domain"};
68  using group = Cce;
69 };
70 
72  using type = double;
73  static constexpr OptionString help{"Extraction radius from the GH system."};
74  using group = Cce;
75 };
76 
77 struct EndTime {
78  using type = double;
79  static constexpr OptionString help{"End time for the Cce Evolution."};
80  static double default_value() noexcept {
82  }
83  using group = Cce;
84 };
85 
86 struct StartTime {
87  using type = double;
88  static constexpr OptionString help{
89  "Cce Start time (default to earliest possible time)."};
90  static double default_value() noexcept {
92  }
93  using group = Cce;
94 };
95 
97  using type = double;
98  static constexpr OptionString help{"Target time step size for Cce Evolution"};
99  using group = Cce;
100 };
101 
103  using type = std::string;
104  static constexpr OptionString help{
105  "H5 file to read the wordltube data from."};
106  using group = Cce;
107 };
108 
110  using type = size_t;
111  static constexpr OptionString help{
112  "Number of times steps from the h5 to cache each read."};
113  static size_t default_value() noexcept { return 200; }
114  using group = Cce;
115 };
116 
119  static constexpr OptionString help{
120  "The interpolator for imported h5 worldtube data."};
121  using group = Cce;
122 };
123 
126  static constexpr OptionString help{
127  "Class to manage worldtube data from a GH system."};
128  using group = Cce;
129 };
130 
132  static std::string name() noexcept { return "ScriInterpOrder"; }
133  using type = size_t;
134  static constexpr OptionString help{"Order of time interpolation at scri+."};
135  static size_t default_value() noexcept { return 5; }
136  using group = Cce;
137 };
138 
140  using type = size_t;
141  static constexpr OptionString help{
142  "Number of scri output points per timestep."};
143  static size_t default_value() noexcept { return 1; }
144  using group = Cce;
145 };
146 
147 struct InitializeJ {
149  static constexpr OptionString help{
150  "The initialization for the first hypersurface for J"};
151  using group = Cce;
152 };
153 
154 } // namespace OptionTags
155 
156 namespace InitializationTags {
157 /// An initialization tag that constructs a `WorldtubeDataManager` from options
159  using type = WorldtubeDataManager;
160  using option_tags =
163 
164  static constexpr bool pass_metavariables = false;
165  static WorldtubeDataManager create_from_options(
166  const size_t l_max, const std::string& filename,
167  const size_t number_of_lookahead_times,
168  const std::unique_ptr<intrp::SpanInterpolator>& interpolator) noexcept {
169  return WorldtubeDataManager{
170  std::make_unique<SpecWorldtubeH5BufferUpdater>(filename), l_max,
171  number_of_lookahead_times, interpolator->get_clone()};
172  }
173 };
174 
176  using type = size_t;
177  using option_tags = tmpl::list<OptionTags::ScriInterpolationOrder>;
178 
179  static constexpr bool pass_metavariables = false;
180  static size_t create_from_options(
181  const size_t scri_plus_interpolation_order) noexcept {
182  return scri_plus_interpolation_order;
183  }
184 };
185 
187  using type = double;
188  using option_tags = tmpl::list<OptionTags::TargetStepSize>;
189 
190  static constexpr bool pass_metavariables = false;
191  static double create_from_options(const double target_step_size) noexcept {
192  return target_step_size;
193  }
194 };
195 
197  using type = double;
198  using option_tags = tmpl::list<OptionTags::ExtractionRadius>;
199 
200  static constexpr bool pass_metavariables = false;
201  static double create_from_options(const double extraction_radius) noexcept {
202  return extraction_radius;
203  }
204 };
205 
207  using type = size_t;
208  using option_tags = tmpl::list<OptionTags::ScriOutputDensity>;
209 
210  static constexpr bool pass_metavariables = false;
211  static size_t create_from_options(const size_t scri_output_density) noexcept {
212  return scri_output_density;
213  }
214 };
215 } // namespace InitializationTags
216 
217 namespace Tags {
219  using type = size_t;
220  using option_tags = tmpl::list<OptionTags::LMax>;
221 
222  static constexpr bool pass_metavariables = false;
223  static size_t create_from_options(const size_t l_max) noexcept {
224  return l_max;
225  }
226 };
227 
230  using type = size_t;
231  using option_tags = tmpl::list<OptionTags::NumberOfRadialPoints>;
232 
233  static constexpr bool pass_metavariables = false;
234  static size_t create_from_options(
235  const size_t number_of_radial_points) noexcept {
236  return number_of_radial_points;
237  }
238 };
239 
241  using type = size_t;
242  using option_tags = tmpl::list<OptionTags::ObservationLMax>;
243 
244  static constexpr bool pass_metavariables = false;
245  static size_t create_from_options(const size_t observation_l_max) noexcept {
246  return observation_l_max;
247  }
248 };
249 
251  using type = size_t;
252  using option_tags = tmpl::list<OptionTags::FilterLMax>;
253 
254  static constexpr bool pass_metavariables = false;
255  static size_t create_from_options(const size_t filter_l_max) noexcept {
256  return filter_l_max;
257  }
258 };
259 
261  using type = double;
262  using option_tags = tmpl::list<OptionTags::RadialFilterAlpha>;
263 
264  static constexpr bool pass_metavariables = false;
265  static double create_from_options(const double radial_filter_alpha) noexcept {
266  return radial_filter_alpha;
267  }
268 };
269 
271  using type = size_t;
272  using option_tags = tmpl::list<OptionTags::RadialFilterHalfPower>;
273 
274  static constexpr bool pass_metavariables = false;
275  static size_t create_from_options(
276  const size_t radial_filter_half_power) noexcept {
277  return radial_filter_half_power;
278  }
279 };
280 
281 /// \brief Represents the start time of a bounded CCE evolution, determined
282 /// either from option specification or from the file
283 ///
284 /// \details If no start time is specified in the input file (so the option
285 /// `OptionTags::StartTime` is set to the default
286 /// `-std::numeric_limits<double>::%infinity()`), this will find the start time
287 /// from the provided H5 file. If `OptionTags::StartTime` takes any other value,
288 /// it will be used directly as the start time for the CCE evolution instead.
290  using type = double;
291  using option_tags =
292  tmpl::list<OptionTags::StartTime, OptionTags::BoundaryDataFilename>;
293 
294  static constexpr bool pass_metavariables = false;
295  static double create_from_options(double start_time,
296  const std::string& filename) noexcept {
297  if (start_time == -std::numeric_limits<double>::infinity()) {
298  SpecWorldtubeH5BufferUpdater h5_boundary_updater{filename};
299  const auto& time_buffer = h5_boundary_updater.get_time_buffer();
300  start_time = time_buffer[0];
301  }
302  return start_time;
303  }
304 };
305 
306 /// \brief Represents the start time of a bounded CCE evolution that must be
307 /// supplied in the input file (for e.g. analytic tests).
309  using type = double;
310  using option_tags = tmpl::list<OptionTags::StartTime>;
311 
312  static constexpr bool pass_metavariables = false;
313  static double create_from_options(const double start_time) noexcept {
314  return start_time;
315  }
316 };
317 
318 /// \brief Represents the final time of a bounded CCE evolution, determined
319 /// either from option specification or from the file
320 ///
321 /// \details If no end time is specified in the input file (so the option
322 /// `OptionTags::EndTime` is set to the default
323 /// `std::numeric_limits<double>::%infinity()`), this will find the end time
324 /// from the provided H5 file. If `OptionTags::EndTime` takes any other value,
325 /// it will be used directly as the final time for the CCE evolution instead.
327  using type = double;
328  using option_tags =
329  tmpl::list<OptionTags::EndTime, OptionTags::BoundaryDataFilename>;
330 
331  static constexpr bool pass_metavariables = false;
332  static double create_from_options(double end_time,
333  const std::string& filename) {
334  if (end_time == std::numeric_limits<double>::infinity()) {
335  SpecWorldtubeH5BufferUpdater h5_boundary_updater{filename};
336  const auto& time_buffer = h5_boundary_updater.get_time_buffer();
337  end_time = time_buffer[time_buffer.size() - 1];
338  }
339  return end_time;
340  }
341 };
342 
343 /// \brief Represents the final time of a CCE evolution that should just proceed
344 /// until it receives no more boundary data and becomes quiescent.
346  using type = double;
347  using option_tags = tmpl::list<>;
348 
349  static constexpr bool pass_metavariables = false;
350  static double create_from_options() noexcept {
352  }
353 };
354 
355 /// \brief Represents the final time of a bounded CCE evolution that must be
356 /// supplied in the input file (for e.g. analytic tests).
358  using type = double;
359  using option_tags =
360  tmpl::list<OptionTags::EndTime>;
361 
362  static constexpr bool pass_metavariables = false;
363  static double create_from_options(const double end_time) noexcept {
364  return end_time;
365  }
366 };
367 
370  using option_tags = tmpl::list<OptionTags::GhInterfaceManager>;
371 
372  static constexpr bool pass_metavariables = false;
374  create_from_options(
376  interface_manager) noexcept {
377  return interface_manager->get_clone();
378  }
379 };
380 
383  using option_tags = tmpl::list<OptionTags::InitializeJ>;
384 
385  static constexpr bool pass_metavariables = false;
386  static std::unique_ptr<::Cce::InitializeJ::InitializeJ> create_from_options(
388  initialize_j) noexcept {
389  return initialize_j->get_clone();
390  }
391 };
392 
393 } // namespace Tags
394 } // namespace Cce
std::string
Cce::InitializationTags::ScriOutputDensity
Definition: OptionTags.hpp:206
Cce::OptionTags::ScriOutputDensity
Definition: OptionTags.hpp:139
Cce::Tags::NumberOfRadialPoints
Definition: OptionTags.hpp:228
Options.hpp
Cce::OptionTags::ObservationLMax
Definition: OptionTags.hpp:58
Cce::OptionTags::H5LookaheadTimes
Definition: OptionTags.hpp:109
Cce::OptionTags::LMax
Definition: OptionTags.hpp:31
db::SimpleTag
Tags for the DataBox inherit from this type.
Definition: Tag.hpp:23
Cce::OptionTags::FilterLMax
Definition: OptionTags.hpp:38
Cce::OptionTags::StartTime
Definition: OptionTags.hpp:86
Cce::OptionTags::EndTime
Definition: OptionTags.hpp:77
Cce::OptionTags::TargetStepSize
Definition: OptionTags.hpp:96
Cce::InitializationTags::H5WorldtubeBoundaryDataManager
An initialization tag that constructs a WorldtubeDataManager from options.
Definition: OptionTags.hpp:158
Cce::Tags::EndTime
Definition: Tags.hpp:346
Cce::Tags::SpecifiedEndTime
Represents the final time of a bounded CCE evolution that must be supplied in the input file (for e....
Definition: OptionTags.hpp:357
Cce::Tags::ObservationLMax
Definition: OptionTags.hpp:240
std::numeric_limits::infinity
T infinity(T... args)
Cce::OptionTags::Cce
Option group
Definition: OptionTags.hpp:21
Cce::SpecWorldtubeH5BufferUpdater
A WorldtubeBufferUpdater specialized to the CCE input worldtube H5 file produced by SpEC.
Definition: ReadBoundaryDataH5.hpp:173
Spectral::Swsh::Tags::NumberOfRadialPointsBase
Base Tag for the number of radial grid points in the three-dimensional representation of radially con...
Definition: SwshTags.hpp:212
cstddef
Cce::OptionTags::ExtractionRadius
Definition: OptionTags.hpp:71
Spectral::Swsh::Tags::LMaxBase
Base Tag for the maximum spin-weighted spherical harmonic l; sets angular resolution.
Definition: SwshTags.hpp:200
Cce::InitializationTags::TargetStepSize
Definition: OptionTags.hpp:186
Cce::OptionTags::RadialFilterHalfPower
Definition: OptionTags.hpp:51
Cce::Tags::NoEndTime
Represents the final time of a CCE evolution that should just proceed until it receives no more bound...
Definition: OptionTags.hpp:345
Cce::Tags::EndTimeFromFile
Represents the final time of a bounded CCE evolution, determined either from option specification or ...
Definition: OptionTags.hpp:326
Cce::Tags::RadialFilterAlpha
Definition: OptionTags.hpp:260
Cce::Tags::GhInterfaceManager
Definition: OptionTags.hpp:368
Cce
The set of utilities for performing Cauchy characteristic evolution and Cauchy characteristic matchin...
Definition: BoundaryComputeAndSendToEvolution.hpp:28
limits
Cce::Tags::FilterLMax
Definition: OptionTags.hpp:250
Cce::Tags::InitializeJ
Definition: OptionTags.hpp:381
Cce::Tags::RadialFilterHalfPower
Definition: OptionTags.hpp:270
Cce::OptionTags::InitializeJ
Definition: OptionTags.hpp:147
Cce::OptionTags::ScriInterpolationOrder
Definition: OptionTags.hpp:131
Cce::OptionTags::RadialFilterAlpha
Definition: OptionTags.hpp:44
Cce::Tags::LMax
Definition: OptionTags.hpp:218
Cce::OptionTags::H5Interpolator
Definition: OptionTags.hpp:117
Cce::OptionTags::Filtering
Option group
Definition: OptionTags.hpp:26
Cce::OptionTags::GhInterfaceManager
Definition: OptionTags.hpp:124
Cce::OptionTags::NumberOfRadialPoints
Definition: OptionTags.hpp:64
Cce::InitializationTags::ScriInterpolationOrder
Definition: OptionTags.hpp:175
Cce::Tags::SpecifiedStartTime
Represents the start time of a bounded CCE evolution that must be supplied in the input file (for e....
Definition: OptionTags.hpp:308
std::unique_ptr< intrp::SpanInterpolator >
Cce::Tags::StartTimeFromFile
Represents the start time of a bounded CCE evolution, determined either from option specification or ...
Definition: OptionTags.hpp:289
std::numeric_limits
Cce::Tags::StartTime
Definition: Tags.hpp:348
OptionString
const char *const OptionString
The string used in option structs.
Definition: Options.hpp:30
Cce::WorldtubeDataManager
Manages the cached buffer data associated with a CCE worldtube and interpolates to requested time poi...
Definition: ReadBoundaryDataH5.hpp:378
Cce::InitializationTags::ExtractionRadius
Definition: OptionTags.hpp:196
Cce::OptionTags::BoundaryDataFilename
Definition: OptionTags.hpp:102