SpECTRE Documentation Coverage Report
Current view: top level - Evolution/Systems/Cce - OptionTags.hpp Hit Total Coverage
Commit: 817e13c5144619b701c7cd870655d8dbf94ab8ce Lines: 16 237 6.8 %
Date: 2024-07-19 22:17:05
Legend: Lines: hit not hit

          Line data    Source code
       1           0 : // Distributed under the MIT License.
       2             : // See LICENSE.txt for details.
       3             : 
       4             : #pragma once
       5             : 
       6             : #include <cstddef>
       7             : #include <limits>
       8             : #include <optional>
       9             : 
      10             : #include "DataStructures/DataBox/Tag.hpp"
      11             : #include "Evolution/Systems/Cce/AnalyticBoundaryDataManager.hpp"
      12             : #include "Evolution/Systems/Cce/AnalyticSolutions/WorldtubeData.hpp"
      13             : #include "Evolution/Systems/Cce/ExtractionRadius.hpp"
      14             : #include "Evolution/Systems/Cce/Initialize/InitializeJ.hpp"
      15             : #include "Evolution/Systems/Cce/InterfaceManagers/GhInterfaceManager.hpp"
      16             : #include "Evolution/Systems/Cce/InterfaceManagers/GhLocalTimeStepping.hpp"
      17             : #include "Evolution/Systems/Cce/InterfaceManagers/GhLockstep.hpp"
      18             : #include "Evolution/Systems/Cce/WorldtubeDataManager.hpp"
      19             : #include "NumericalAlgorithms/Interpolation/SpanInterpolator.hpp"
      20             : #include "Options/Auto.hpp"
      21             : #include "Options/String.hpp"
      22             : #include "Parallel/Printf/Printf.hpp"
      23             : #include "Utilities/PrettyType.hpp"
      24             : 
      25             : namespace Cce {
      26           0 : namespace OptionTags {
      27             : 
      28             : /// %Option group
      29           1 : struct Cce {
      30           0 :   static constexpr Options::String help = {
      31             :       "Options for the Cce evolution system"};
      32             : };
      33             : 
      34             : /// %Option group
      35           1 : struct Filtering {
      36           0 :   static constexpr Options::String help = {"Options for the filtering in Cce"};
      37           0 :   using group = Cce;
      38             : };
      39             : 
      40             : /// %Option group for evolution-related quantities in the CCE system
      41           1 : struct Evolution {
      42           0 :   static constexpr Options::String help = {"Options for the CCE evolution"};
      43           0 :   using group = Cce;
      44             : };
      45             : 
      46             : /// A prefix for common tags (e.g. from Time/Tags.hpp) that are specific to CCE,
      47             : /// so should be in the Cce::Evolution group.
      48             : template <typename OptionTag>
      49           1 : struct CceEvolutionPrefix {
      50           0 :   using type = typename OptionTag::type;
      51           0 :   static std::string name() { return pretty_type::name<OptionTag>(); }
      52           0 :   static constexpr Options::String help = OptionTag::help;
      53           0 :   using group = Evolution;
      54             : };
      55             : 
      56           0 : struct BondiSachsOutputFilePrefix {
      57           0 :   using type = std::string;
      58           0 :   static constexpr Options::String help{
      59             :       "Filename prefix for dumping Bondi-Sachs data on worltube radii. Files "
      60             :       "will have this prefix prepended to 'CceRXXXX.h5' where XXXX will be the "
      61             :       "zero-padded extraction radius to the nearest integer."};
      62           0 :   using group = Cce;
      63             : };
      64             : 
      65           0 : struct LMax {
      66           0 :   using type = size_t;
      67           0 :   static constexpr Options::String help{
      68             :       "Maximum l value for spin-weighted spherical harmonics"};
      69           0 :   using group = Cce;
      70             : };
      71             : 
      72           0 : struct FilterLMax {
      73           0 :   using type = size_t;
      74           0 :   static constexpr Options::String help{"l mode cutoff for angular filtering"};
      75           0 :   using group = Filtering;
      76             : };
      77             : 
      78           0 : struct RadialFilterAlpha {
      79           0 :   using type = double;
      80           0 :   static constexpr Options::String help{
      81             :       "alpha parameter in exponential radial filter"};
      82           0 :   using group = Filtering;
      83             : };
      84             : 
      85           0 : struct RadialFilterHalfPower {
      86           0 :   using type = size_t;
      87           0 :   static constexpr Options::String help{
      88             :       "Half-power of the exponential radial filter argument"};
      89           0 :   using group = Filtering;
      90             : };
      91             : 
      92           0 : struct ObservationLMax {
      93           0 :   using type = size_t;
      94           0 :   static constexpr Options::String help{"Maximum l value for swsh output"};
      95           0 :   using group = Cce;
      96             : };
      97             : 
      98           0 : struct NumberOfRadialPoints {
      99           0 :   using type = size_t;
     100           0 :   static constexpr Options::String help{
     101             :       "Number of radial grid points in the spherical domain"};
     102           0 :   using group = Cce;
     103             : };
     104             : 
     105           0 : struct ExtractionRadius {
     106           0 :   using type = double;
     107           0 :   static constexpr Options::String help{"Extraction radius of the CCE system."};
     108           0 :   using group = Cce;
     109             : };
     110             : 
     111           0 : struct StandaloneExtractionRadius {
     112           0 :   static std::string name() { return "ExtractionRadius"; }
     113           0 :   using type = Options::Auto<double>;
     114             : 
     115           0 :   static constexpr Options::String help{
     116             :       "Extraction radius of the CCE system for a standalone run. This may be "
     117             :       "set to \"Auto\" to infer the radius from the filename (often used for "
     118             :       "SpEC worldtube data). This option is unused if `H5IsBondiData` is "
     119             :       "`true`, and should be \"Auto\" for such runs."};
     120           0 :   using group = Cce;
     121             : };
     122             : 
     123           0 : struct EndTime {
     124           0 :   using type = Options::Auto<double>;
     125           0 :   static constexpr Options::String help{"End time for the Cce Evolution."};
     126           0 :   static type suggested_value() { return {}; }
     127           0 :   using group = Cce;
     128             : };
     129             : 
     130           0 : struct StartTime {
     131           0 :   using type = Options::Auto<double>;
     132           0 :   static constexpr Options::String help{
     133             :       "Cce Start time (default to earliest possible time)."};
     134           0 :   static type suggested_value() { return {}; }
     135           0 :   using group = Cce;
     136             : };
     137             : 
     138           0 : struct BoundaryDataFilename {
     139           0 :   using type = std::string;
     140           0 :   static constexpr Options::String help{
     141             :       "H5 file to read the wordltube data from."};
     142           0 :   using group = Cce;
     143             : };
     144             : 
     145           0 : struct KleinGordonBoundaryDataFilename {
     146           0 :   using type = std::string;
     147           0 :   static constexpr Options::String help{
     148             :       "H5 file to read the Klein-Gordon wordltube data from. It could be the "
     149             :       "same as/different from `BoundaryDataFilename`."};
     150           0 :   using group = Cce;
     151             : };
     152             : 
     153           0 : struct H5LookaheadTimes {
     154           0 :   using type = size_t;
     155           0 :   static constexpr Options::String help{
     156             :       "Number of times steps from the h5 to cache each read."};
     157           0 :   static size_t suggested_value() { return 200; }
     158           0 :   using group = Cce;
     159             : };
     160             : 
     161           0 : struct H5Interpolator {
     162           0 :   using type = std::unique_ptr<intrp::SpanInterpolator>;
     163           0 :   static constexpr Options::String help{
     164             :       "The interpolator for imported h5 worldtube data."};
     165           0 :   using group = Cce;
     166             : };
     167             : 
     168           0 : struct H5IsBondiData {
     169           0 :   using type = bool;
     170           0 :   static constexpr Options::String help{
     171             :       "true for boundary data in Bondi form, false for metric data. Metric "
     172             :       "data is more readily available from Cauchy simulations, so historically "
     173             :       "has been the typical format provided by SpEC simulations. Bondi data is "
     174             :       "much more efficient for storage size and performance, but both must be "
     175             :       "supported for compatibility with current CCE data sources."};
     176           0 :   using group = Cce;
     177             : };
     178             : 
     179           0 : struct FixSpecNormalization {
     180           0 :   using type = bool;
     181           0 :   static constexpr Options::String help{
     182             :       "Set to true if corrections for SpEC data impurities should be applied "
     183             :       "automatically based on the `VersionHist.ver` data set in the H5. "
     184             :       "Typically, this should be set to true if the metric data is created "
     185             :       "from SpEC, and false otherwise."};
     186           0 :   using group = Cce;
     187             : };
     188             : 
     189           0 : struct AnalyticSolution {
     190           0 :   using type = std::unique_ptr<Solutions::WorldtubeData>;
     191           0 :   static constexpr Options::String help{
     192             :       "Analytic worldtube data for tests of CCE."};
     193           0 :   using group = Cce;
     194             : };
     195             : 
     196           0 : struct GhInterfaceManager {
     197           0 :   using type = InterfaceManagers::GhLocalTimeStepping;
     198           0 :   static constexpr Options::String help{
     199             :       "Class to manage worldtube data from a GH system."};
     200           0 :   using group = Cce;
     201             : };
     202             : 
     203           0 : struct ScriInterpolationOrder {
     204           0 :   static std::string name() { return "ScriInterpOrder"; }
     205           0 :   using type = size_t;
     206           0 :   static constexpr Options::String help{
     207             :       "Order of time interpolation at scri+."};
     208           0 :   static size_t suggested_value() { return 5; }
     209           0 :   using group = Cce;
     210             : };
     211             : 
     212           0 : struct ScriOutputDensity {
     213           0 :   using type = size_t;
     214           0 :   static constexpr Options::String help{
     215             :       "Number of scri output points per timestep."};
     216           0 :   static size_t suggested_value() { return 1; }
     217           0 :   using group = Cce;
     218             : };
     219             : 
     220             : template <bool evolve_ccm>
     221           0 : struct InitializeJ {
     222           0 :   using type = std::unique_ptr<::Cce::InitializeJ::InitializeJ<evolve_ccm>>;
     223           0 :   static constexpr Options::String help{
     224             :       "The initialization for the first hypersurface for J"};
     225           0 :   using group = Cce;
     226             : };
     227             : }  // namespace OptionTags
     228             : 
     229           0 : namespace InitializationTags {
     230           0 : struct ScriInterpolationOrder : db::SimpleTag {
     231           0 :   using type = size_t;
     232           0 :   using option_tags = tmpl::list<OptionTags::ScriInterpolationOrder>;
     233             : 
     234           0 :   static constexpr bool pass_metavariables = false;
     235           0 :   static size_t create_from_options(
     236             :       const size_t scri_plus_interpolation_order) {
     237             :     return scri_plus_interpolation_order;
     238             :   }
     239             : };
     240             : 
     241           0 : struct ScriOutputDensity : db::SimpleTag {
     242           0 :   using type = size_t;
     243           0 :   using option_tags = tmpl::list<OptionTags::ScriOutputDensity>;
     244             : 
     245           0 :   static constexpr bool pass_metavariables = false;
     246           0 :   static size_t create_from_options(const size_t scri_output_density) {
     247             :     return scri_output_density;
     248             :   }
     249             : };
     250             : }  // namespace InitializationTags
     251             : 
     252             : namespace Tags {
     253           0 : struct ExtractionRadius : db::BaseTag {};
     254             : 
     255           0 : struct ExtractionRadiusSimple : ExtractionRadius, db::SimpleTag {
     256           0 :   static std::string name() { return "ExtractionRadius"; }
     257           0 :   using type = double;
     258           0 :   using option_tags = tmpl::list<OptionTags::ExtractionRadius>;
     259             : 
     260           0 :   static constexpr bool pass_metavariables = false;
     261           0 :   static double create_from_options(const double extraction_radius) {
     262             :     return extraction_radius;
     263             :   }
     264             : };
     265             : 
     266           0 : struct ExtractionRadiusFromH5 : ExtractionRadius, db::SimpleTag {
     267           0 :   static std::string name() { return "ExtractionRadius"; }
     268           0 :   using type = double;
     269           0 :   using option_tags = tmpl::list<OptionTags::BoundaryDataFilename,
     270             :                                  OptionTags::StandaloneExtractionRadius>;
     271             : 
     272           0 :   static constexpr bool pass_metavariables = false;
     273           0 :   static double create_from_options(
     274             :       const std::string& filename,
     275             :       const std::optional<double>& extraction_radius) {
     276             :     const std::optional<double> radius =
     277             :         Cce::get_extraction_radius(filename, extraction_radius);
     278             :     return radius.value();
     279             :   }
     280             : };
     281             : 
     282           0 : struct FilePrefix : db::SimpleTag {
     283           0 :   using type = std::string;
     284           0 :   using option_tags = tmpl::list<OptionTags::BondiSachsOutputFilePrefix>;
     285           0 :   static constexpr bool pass_metavariables = false;
     286           0 :   static type create_from_options(const type& option) { return option; }
     287             : };
     288             : 
     289             : /// Tag for duplicating functionality of another tag, but allows creation from
     290             : /// options in the Cce::Evolution option group.
     291             : template <typename Tag>
     292           1 : struct CceEvolutionPrefix : Tag {
     293           0 :   using type = typename Tag::type;
     294           0 :   using option_tags = db::wrap_tags_in<OptionTags::CceEvolutionPrefix,
     295             :                                        typename Tag::option_tags>;
     296           0 :   static std::string name() { return pretty_type::name<Tag>(); }
     297             : 
     298           0 :   static constexpr bool pass_metavariables = Tag::pass_metavariables;
     299             :   template <typename Metavariables, typename... Args>
     300           0 :   static type create_from_options(const Args&... args) {
     301             :     return Tag::template create_from_options<Metavariables>(args...);
     302             :   }
     303             : 
     304             :   template <typename... Args>
     305           0 :   static type create_from_options(const Args&... args) {
     306             :     return Tag::create_from_options(args...);
     307             :   }
     308             : };
     309             : 
     310             : /// A tag that constructs a `MetricWorldtubeDataManager` or
     311             : /// `BondiWorldtubeDataManager` from options
     312           1 : struct H5WorldtubeBoundaryDataManager : db::SimpleTag {
     313           0 :   using type = std::unique_ptr<WorldtubeDataManager<
     314             :       Tags::characteristic_worldtube_boundary_tags<Tags::BoundaryValue>>>;
     315           0 :   using option_tags =
     316             :       tmpl::list<OptionTags::LMax, OptionTags::BoundaryDataFilename,
     317             :                  OptionTags::H5LookaheadTimes, OptionTags::H5Interpolator,
     318             :                  OptionTags::H5IsBondiData, OptionTags::FixSpecNormalization,
     319             :                  OptionTags::StandaloneExtractionRadius>;
     320             : 
     321           0 :   static constexpr bool pass_metavariables = false;
     322           0 :   static type create_from_options(
     323             :       const size_t l_max, const std::string& filename,
     324             :       const size_t number_of_lookahead_times,
     325             :       const std::unique_ptr<intrp::SpanInterpolator>& interpolator,
     326             :       const bool h5_is_bondi_data, const bool fix_spec_normalization,
     327             :       const std::optional<double> extraction_radius) {
     328             :     if (h5_is_bondi_data) {
     329             :       if (static_cast<bool>(extraction_radius)) {
     330             :         Parallel::printf(
     331             :             "Warning: Option ExtractionRadius is set to a specific value and "
     332             :             "H5IsBondiData is set to `true` -- the ExtractionRadius will not "
     333             :             "be used, because all radius information is specified in the input "
     334             :             "file for the Bondi worldtube data format. It is recommended to "
     335             :             "set `ExtractionRadius` to `\"Auto\"` to make the input file "
     336             :             "clearer.\n");
     337             :       }
     338             :       return std::make_unique<BondiWorldtubeDataManager>(
     339             :           std::make_unique<BondiWorldtubeH5BufferUpdater>(filename,
     340             :                                                           extraction_radius),
     341             :           l_max, number_of_lookahead_times, interpolator->get_clone());
     342             :     } else {
     343             :       return std::make_unique<MetricWorldtubeDataManager>(
     344             :           std::make_unique<MetricWorldtubeH5BufferUpdater>(filename,
     345             :                                                            extraction_radius),
     346             :           l_max, number_of_lookahead_times, interpolator->get_clone(),
     347             :           fix_spec_normalization);
     348             :     }
     349             :   }
     350             : };
     351             : 
     352             : /// A tag that constructs a `KleinGordonWorldtubeDataManager` from options
     353           1 : struct KleinGordonH5WorldtubeBoundaryDataManager : db::SimpleTag {
     354           0 :   using type = std::unique_ptr<
     355             :       WorldtubeDataManager<Tags::klein_gordon_worldtube_boundary_tags>>;
     356           0 :   using option_tags =
     357             :       tmpl::list<OptionTags::LMax, OptionTags::KleinGordonBoundaryDataFilename,
     358             :                  OptionTags::H5LookaheadTimes, OptionTags::H5Interpolator,
     359             :                  OptionTags::StandaloneExtractionRadius>;
     360             : 
     361           0 :   static constexpr bool pass_metavariables = false;
     362           0 :   static type create_from_options(
     363             :       const size_t l_max, const std::string& filename,
     364             :       const size_t number_of_lookahead_times,
     365             :       const std::unique_ptr<intrp::SpanInterpolator>& interpolator,
     366             :       const std::optional<double> extraction_radius) {
     367             :     return std::make_unique<KleinGordonWorldtubeDataManager>(
     368             :         std::make_unique<KleinGordonWorldtubeH5BufferUpdater>(
     369             :             filename, extraction_radius),
     370             :         l_max, number_of_lookahead_times, interpolator->get_clone());
     371             :   }
     372             : };
     373             : 
     374           0 : struct LMax : db::SimpleTag, Spectral::Swsh::Tags::LMaxBase {
     375           0 :   using type = size_t;
     376           0 :   using option_tags = tmpl::list<OptionTags::LMax>;
     377             : 
     378           0 :   static constexpr bool pass_metavariables = false;
     379           0 :   static size_t create_from_options(const size_t l_max) { return l_max; }
     380             : };
     381             : 
     382           0 : struct NumberOfRadialPoints : db::SimpleTag,
     383             :                               Spectral::Swsh::Tags::NumberOfRadialPointsBase {
     384           0 :   using type = size_t;
     385           0 :   using option_tags = tmpl::list<OptionTags::NumberOfRadialPoints>;
     386             : 
     387           0 :   static constexpr bool pass_metavariables = false;
     388           0 :   static size_t create_from_options(const size_t number_of_radial_points) {
     389             :     return number_of_radial_points;
     390             :   }
     391             : };
     392             : 
     393           0 : struct ObservationLMax : db::SimpleTag {
     394           0 :   using type = size_t;
     395           0 :   using option_tags = tmpl::list<OptionTags::ObservationLMax>;
     396             : 
     397           0 :   static constexpr bool pass_metavariables = false;
     398           0 :   static size_t create_from_options(const size_t observation_l_max) {
     399             :     return observation_l_max;
     400             :   }
     401             : };
     402             : 
     403           0 : struct FilterLMax : db::SimpleTag {
     404           0 :   using type = size_t;
     405           0 :   using option_tags = tmpl::list<OptionTags::FilterLMax>;
     406             : 
     407           0 :   static constexpr bool pass_metavariables = false;
     408           0 :   static size_t create_from_options(const size_t filter_l_max) {
     409             :     return filter_l_max;
     410             :   }
     411             : };
     412             : 
     413           0 : struct RadialFilterAlpha : db::SimpleTag {
     414           0 :   using type = double;
     415           0 :   using option_tags = tmpl::list<OptionTags::RadialFilterAlpha>;
     416             : 
     417           0 :   static constexpr bool pass_metavariables = false;
     418           0 :   static double create_from_options(const double radial_filter_alpha) {
     419             :     return radial_filter_alpha;
     420             :   }
     421             : };
     422             : 
     423           0 : struct RadialFilterHalfPower : db::SimpleTag {
     424           0 :   using type = size_t;
     425           0 :   using option_tags = tmpl::list<OptionTags::RadialFilterHalfPower>;
     426             : 
     427           0 :   static constexpr bool pass_metavariables = false;
     428           0 :   static size_t create_from_options(const size_t radial_filter_half_power) {
     429             :     return radial_filter_half_power;
     430             :   }
     431             : };
     432             : 
     433             : /// \brief Represents the start time of a bounded CCE evolution, determined
     434             : /// either from option specification or from the file
     435             : ///
     436             : /// \details If no start time is specified in the input file (so the option
     437             : /// `OptionTags::StartTime` is set to "Auto"), this will find the start time
     438             : /// from the provided H5 file. If `OptionTags::StartTime` takes any other value,
     439             : /// it will be used directly as the start time for the CCE evolution instead.
     440           1 : struct StartTimeFromFile : Tags::StartTime, db::SimpleTag {
     441           0 :   using type = double;
     442           0 :   using option_tags =
     443             :       tmpl::list<OptionTags::StartTime, OptionTags::BoundaryDataFilename,
     444             :                  OptionTags::H5IsBondiData>;
     445             : 
     446           0 :   static constexpr bool pass_metavariables = false;
     447           0 :   static double create_from_options(const std::optional<double> start_time,
     448             :                                     const std::string& filename,
     449             :                                     const bool is_bondi_data) {
     450             :     if (start_time) {
     451             :       return *start_time;
     452             :     }
     453             :     if (is_bondi_data) {
     454             :       BondiWorldtubeH5BufferUpdater h5_boundary_updater{filename};
     455             :       const auto& time_buffer = h5_boundary_updater.get_time_buffer();
     456             :       return time_buffer[0];
     457             :     } else {
     458             :       MetricWorldtubeH5BufferUpdater h5_boundary_updater{filename};
     459             :       const auto& time_buffer = h5_boundary_updater.get_time_buffer();
     460             :       return time_buffer[0];
     461             :     }
     462             :   }
     463             : };
     464             : 
     465             : /// \brief Represents the start time of a bounded CCE evolution that must be
     466             : /// supplied in the input file (for e.g. analytic tests).
     467           1 : struct SpecifiedStartTime : Tags::StartTime, db::SimpleTag {
     468           0 :   using type = double;
     469           0 :   using option_tags = tmpl::list<OptionTags::StartTime>;
     470             : 
     471           0 :   static constexpr bool pass_metavariables = false;
     472           0 :   static double create_from_options(const std::optional<double> start_time) {
     473             :     if (not start_time.has_value()) {
     474             :       ERROR(
     475             :           "The start time must be explicitly specified for the tag "
     476             :           "`SpecifiedStartTime`");
     477             :     }
     478             :     return *start_time;
     479             :   }
     480             : };
     481             : 
     482             : /// \brief Represents the final time of a bounded CCE evolution, determined
     483             : /// either from option specification or from the file
     484             : ///
     485             : /// \details If no end time is specified in the input file (so the option
     486             : /// `OptionTags::EndTime` is set to "Auto"), this will find the end time
     487             : /// from the provided H5 file. If `OptionTags::EndTime` takes any other value,
     488             : /// it will be used directly as the final time for the CCE evolution instead.
     489           1 : struct EndTimeFromFile : Tags::EndTime, db::SimpleTag {
     490           0 :   using type = double;
     491           0 :   using option_tags =
     492             :       tmpl::list<OptionTags::EndTime, OptionTags::BoundaryDataFilename,
     493             :                  OptionTags::H5IsBondiData>;
     494             : 
     495           0 :   static constexpr bool pass_metavariables = false;
     496           0 :   static double create_from_options(const std::optional<double> end_time,
     497             :                                     const std::string& filename,
     498             :                                     const bool is_bondi_data) {
     499             :     if (end_time) {
     500             :       return *end_time;
     501             :     }
     502             :     if (is_bondi_data) {
     503             :       BondiWorldtubeH5BufferUpdater h5_boundary_updater{filename};
     504             :       const auto& time_buffer = h5_boundary_updater.get_time_buffer();
     505             :       return time_buffer[time_buffer.size() - 1];
     506             :     } else {
     507             :       MetricWorldtubeH5BufferUpdater h5_boundary_updater{filename};
     508             :       const auto& time_buffer = h5_boundary_updater.get_time_buffer();
     509             :       return time_buffer[time_buffer.size() - 1];
     510             :     }
     511             :   }
     512             : };
     513             : 
     514             : /// \brief Represents the final time of a CCE evolution that should just proceed
     515             : /// until it receives no more boundary data and becomes quiescent.
     516           1 : struct NoEndTime : Tags::EndTime, db::SimpleTag {
     517           0 :   using type = double;
     518           0 :   using option_tags = tmpl::list<>;
     519             : 
     520           0 :   static constexpr bool pass_metavariables = false;
     521           0 :   static double create_from_options() {
     522             :     return std::numeric_limits<double>::infinity();
     523             :   }
     524             : };
     525             : 
     526             : /// \brief Represents the final time of a bounded CCE evolution that must be
     527             : /// supplied in the input file (for e.g. analytic tests).
     528           1 : struct SpecifiedEndTime : Tags::EndTime, db::SimpleTag {
     529           0 :   using type = double;
     530           0 :   using option_tags = tmpl::list<OptionTags::EndTime>;
     531             : 
     532           0 :   static constexpr bool pass_metavariables = false;
     533           0 :   static double create_from_options(const std::optional<double> end_time) {
     534             :     if (not end_time.has_value()) {
     535             :       ERROR(
     536             :           "The end time must be explicitly specified for the tag "
     537             :           "`SpecifiedEndTime`");
     538             :     }
     539             :     return *end_time;
     540             :   }
     541             : };
     542             : 
     543           0 : struct GhInterfaceManager : db::SimpleTag {
     544           0 :   using type = InterfaceManagers::GhLocalTimeStepping;
     545           0 :   using option_tags = tmpl::list<OptionTags::GhInterfaceManager>;
     546             : 
     547           0 :   static constexpr bool pass_metavariables = false;
     548           0 :   static InterfaceManagers::GhLocalTimeStepping create_from_options(
     549             :       const InterfaceManagers::GhLocalTimeStepping& interface_manager) {
     550             :     return interface_manager;
     551             :   }
     552             : };
     553             : 
     554             : /// Base tag for first-hypersurface initialization procedure
     555           1 : struct InitializeJBase : db::BaseTag {};
     556             : 
     557             : /// Tag for first-hypersurface initialization procedure specified by input
     558             : /// options.
     559             : template <bool evolve_ccm>
     560           1 : struct InitializeJ : db::SimpleTag, InitializeJBase {
     561           0 :   using type = std::unique_ptr<::Cce::InitializeJ::InitializeJ<evolve_ccm>>;
     562           0 :   using option_tags = tmpl::list<OptionTags::InitializeJ<evolve_ccm>>;
     563             : 
     564           0 :   static constexpr bool pass_metavariables = false;
     565             :   static std::unique_ptr<::Cce::InitializeJ::InitializeJ<evolve_ccm>>
     566           0 :   create_from_options(
     567             :       const std::unique_ptr<::Cce::InitializeJ::InitializeJ<evolve_ccm>>&
     568             :           initialize_j) {
     569             :     return initialize_j->get_clone();
     570             :   }
     571             : };
     572             : 
     573             : // Tags that generates an `Cce::InitializeJ::InitializeJ` derived class from an
     574             : // analytic solution.
     575           0 : struct AnalyticInitializeJ : db::SimpleTag, InitializeJBase {
     576           0 :   using type = std::unique_ptr<::Cce::InitializeJ::InitializeJ<false>>;
     577           0 :   using option_tags =
     578             :       tmpl::list<OptionTags::AnalyticSolution, OptionTags::StartTime>;
     579           0 :   static constexpr bool pass_metavariables = false;
     580             :   static std::unique_ptr<::Cce::InitializeJ::InitializeJ<false>>
     581           0 :   create_from_options(
     582             :       const std::unique_ptr<Cce::Solutions::WorldtubeData>& worldtube_data,
     583             :       const std::optional<double> start_time) {
     584             :     return worldtube_data->get_initialize_j(*start_time);
     585             :   }
     586             : };
     587             : 
     588             : /// A tag that constructs a `AnalyticBoundaryDataManager` from options
     589           1 : struct AnalyticBoundaryDataManager : db::SimpleTag {
     590           0 :   using type = ::Cce::AnalyticBoundaryDataManager;
     591           0 :   using option_tags = tmpl::list<OptionTags::ExtractionRadius, OptionTags::LMax,
     592             :                                  OptionTags::AnalyticSolution>;
     593             : 
     594           0 :   static constexpr bool pass_metavariables = false;
     595           0 :   static Cce::AnalyticBoundaryDataManager create_from_options(
     596             :       const double extraction_radius, const size_t l_max,
     597             :       const std::unique_ptr<Cce::Solutions::WorldtubeData>& worldtube_data) {
     598             :     return ::Cce::AnalyticBoundaryDataManager(l_max, extraction_radius,
     599             :                                               worldtube_data->get_clone());
     600             :   }
     601             : };
     602             : 
     603             : /// Represents whether the news should be provided at noninertial times.
     604             : ///
     605             : /// \details Currently, this is only useful for analytic solutions for which the
     606             : /// inertial-time news is difficult to compute.
     607           1 : struct OutputNoninertialNews : db::SimpleTag {
     608           0 :   using type = bool;
     609           0 :   using option_tags = tmpl::list<OptionTags::AnalyticSolution>;
     610           0 :   static constexpr bool pass_metavariables = false;
     611           0 :   static bool create_from_options(
     612             :       const std::unique_ptr<Cce::Solutions::WorldtubeData>& worldtube_data) {
     613             :     return worldtube_data->use_noninertial_news();
     614             :   }
     615             : };
     616             : }  // namespace Tags
     617             : }  // namespace Cce

Generated by: LCOV version 1.14