CharacteristicExtract.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include "Evolution/Systems/Cce/AnalyticSolutions/BouncingBlackHole.hpp"
7 #include "Evolution/Systems/Cce/AnalyticSolutions/GaugeWave.hpp"
8 #include "Evolution/Systems/Cce/AnalyticSolutions/LinearizedBondiSachs.hpp"
9 #include "Evolution/Systems/Cce/AnalyticSolutions/RobinsonTrautman.hpp"
10 #include "Evolution/Systems/Cce/AnalyticSolutions/RotatingSchwarzschild.hpp"
11 #include "Evolution/Systems/Cce/AnalyticSolutions/SphericalMetricData.hpp"
12 #include "Evolution/Systems/Cce/AnalyticSolutions/TeukolskyWave.hpp"
13 #include "Evolution/Systems/Cce/AnalyticSolutions/WorldtubeData.hpp"
14 #include "Evolution/Systems/Cce/BoundaryData.hpp"
15 #include "Evolution/Systems/Cce/Components/CharacteristicEvolution.hpp"
16 #include "Evolution/Systems/Cce/Components/WorldtubeBoundary.hpp"
17 #include "Evolution/Systems/Cce/Initialize/InitializeJ.hpp"
18 #include "Evolution/Systems/Cce/Initialize/InverseCubic.hpp"
19 #include "Evolution/Systems/Cce/Initialize/NoIncomingRadiation.hpp"
20 #include "Evolution/Systems/Cce/Initialize/RegisterInitializeJWithCharm.hpp"
21 #include "Evolution/Systems/Cce/Initialize/ZeroNonSmooth.hpp"
22 #include "Evolution/Systems/Cce/IntegrandInputSteps.hpp"
23 #include "Evolution/Systems/Cce/OptionTags.hpp"
24 #include "Evolution/Systems/Cce/System.hpp"
25 #include "Evolution/Systems/Cce/Tags.hpp"
26 #include "Evolution/Systems/Cce/WorldtubeDataManager.hpp"
27 #include "IO/Observer/ObserverComponent.hpp"
28 #include "NumericalAlgorithms/Interpolation/BarycentricRationalSpanInterpolator.hpp"
29 #include "NumericalAlgorithms/Interpolation/CubicSpanInterpolator.hpp"
30 #include "NumericalAlgorithms/Interpolation/LinearSpanInterpolator.hpp"
31 #include "NumericalAlgorithms/Interpolation/SpanInterpolator.hpp"
32 #include "Options/Options.hpp"
33 #include "Options/Protocols/FactoryCreation.hpp"
35 #include "Parallel/InitializationFunctions.hpp"
37 #include "Time/StepChoosers/ErrorControl.hpp"
38 #include "Time/StepChoosers/Factory.hpp"
39 #include "Time/StepChoosers/Increase.hpp"
40 #include "Time/StepControllers/Factory.hpp"
41 #include "Time/Tags.hpp"
42 #include "Time/TimeSteppers/TimeStepper.hpp"
43 #include "Utilities/Blas.hpp"
45 #include "Utilities/MemoryHelpers.hpp"
46 #include "Utilities/ProtocolHelpers.hpp"
47 
48 /// \cond
49 namespace PUP {
50 class er;
51 } // namespace PUP
52 /// \endcond
53 
54 template <template <typename> class BoundaryComponent>
55 struct EvolutionMetavars {
56  using system = Cce::System;
57  static constexpr bool local_time_stepping = true;
58 
59  using evolved_swsh_tag = Cce::Tags::BondiJ;
60  using evolved_swsh_dt_tag = Cce::Tags::BondiH;
61  using evolved_coordinates_variables_tag =
64 
66  static std::string name() noexcept { return "SwshVars"; }
67  };
68 
70  static std::string name() noexcept { return "CoordVars"; }
71  };
72 
73  using cce_boundary_communication_tags =
76 
77  using cce_gauge_boundary_tags = tmpl::flatten<tmpl::list<
78  tmpl::transform<
83  tmpl::bind<Cce::Tags::EvolutionGaugeBoundaryValue, tmpl::_1>>,
90 
91  using scri_values_to_observe =
92  tmpl::list<Cce::Tags::News, Cce::Tags::ScriPlus<Cce::Tags::Strain>,
100 
101  using cce_scri_tags =
102  tmpl::list<Cce::Tags::News, Cce::Tags::ScriPlus<Cce::Tags::Strain>,
109  using cce_integrand_tags = tmpl::flatten<tmpl::transform<
112  tmpl::_1>>>;
113  using cce_integration_independent_tags =
114  tmpl::push_back<Cce::pre_computation_tags, Cce::Tags::DuRDividedByR>;
115  using cce_temporary_equations_tags = tmpl::remove_duplicates<tmpl::flatten<
116  tmpl::transform<cce_integrand_tags,
117  tmpl::bind<Cce::integrand_temporary_tags, tmpl::_1>>>>;
118  using cce_pre_swsh_derivatives_tags = Cce::all_pre_swsh_derivative_tags;
119  using cce_transform_buffer_tags = Cce::all_transform_buffer_tags;
120  using cce_swsh_derivative_tags = Cce::all_swsh_derivative_tags;
121  using cce_angular_coordinate_tags =
122  tmpl::list<Cce::Tags::CauchyAngularCoords>;
123 
124  using cce_boundary_component = BoundaryComponent<EvolutionMetavars>;
125 
126  using component_list =
127  tmpl::list<observers::ObserverWriter<EvolutionMetavars>,
128  cce_boundary_component,
130 
131  struct factory_creation
132  : tt::ConformsTo<Options::protocols::FactoryCreation> {
133  using factory_classes = tmpl::map<
134  tmpl::pair<StepChooser<StepChooserUse::LtsStep>,
135  tmpl::list<StepChoosers::Constant<StepChooserUse::LtsStep>,
143  tmpl::pair<StepController, StepControllers::standard_step_controllers>,
144  tmpl::pair<TimeSequence<double>,
145  TimeSequences::all_time_sequences<double>>,
146  tmpl::pair<TimeSequence<std::uint64_t>,
147  TimeSequences::all_time_sequences<std::uint64_t>>>;
148  };
149 
150  using observed_reduction_data_tags = tmpl::list<>;
151 
152  static constexpr Options::String help{
153  "Perform Cauchy Characteristic Extraction using .h5 input data.\n"
154  "Uses regularity-preserving formulation."};
155 
156  enum class Phase {
157  Initialization,
158  InitializeTimeStepperHistory,
159  Evolve,
160  Exit
161  };
162 
163  template <typename... Tags>
164  static Phase determine_next_phase(
165  const gsl::not_null<
166  tuples::TaggedTuple<Tags...>*> /*phase_change_decision_data*/,
167  const Phase& current_phase,
168  const Parallel::CProxy_GlobalCache<
169  EvolutionMetavars>& /*cache_proxy*/) noexcept {
170  if (current_phase == Phase::Initialization) {
171  return Phase::InitializeTimeStepperHistory;
172  } else if (current_phase == Phase::InitializeTimeStepperHistory) {
173  return Phase::Evolve;
174  } else {
175  return Phase::Exit;
176  }
177  }
178 
179  // NOLINTNEXTLINE(google-runtime-references)
180  void pup(PUP::er& /*p*/) noexcept {}
181 };
182 
183 static const std::vector<void (*)()> charm_init_node_funcs{
184  &setup_error_handling,
185  &setup_memory_allocation_failure_reporting,
187  &Cce::register_initialize_j_with_charm,
192  &Parallel::register_derived_classes_with_charm<Cce::WorldtubeDataManager>,
193  &Parallel::register_derived_classes_with_charm<TimeStepper>,
194  &Parallel::register_derived_classes_with_charm<intrp::SpanInterpolator>,
197  &Parallel::register_factory_classes_with_charm<metavariables>};
198 
199 static const std::vector<void (*)()> charm_init_proc_funcs{
FloatingPointExceptions.hpp
EvolutionMetavars::coord_vars_selector
Definition: CharacteristicExtract.hpp:69
Cce::Tags::BondiH
::Tags::dt< BondiJ > BondiH
Bondi parameter .
Definition: Tags.hpp:64
RegisterDerivedClassesWithCharm.hpp
Cce::all_swsh_derivative_tags
tmpl::remove_duplicates< tmpl::flatten< tmpl::list< tmpl::transform< bondi_hypersurface_step_tags, tmpl::bind< tmpl::list, single_swsh_derivative_tags_to_compute_for< tmpl::_1 >, second_swsh_derivative_tags_to_compute_for< tmpl::_1 > >>, all_swsh_derivative_tags_for_scri > >> all_swsh_derivative_tags
A typelist for the set of tags computed by spin-weighted differentiation using utilities from the Sws...
Definition: IntegrandInputSteps.hpp:309
std::string
Cce::Tags::BondiW
Bondi parameter .
Definition: Tags.hpp:109
Cce::System
Definition: System.hpp:116
EvolutionMetavars::swsh_vars_selector
Definition: CharacteristicExtract.hpp:65
StepChoosers::ErrorControl
Suggests a step size based on a target absolute and/or relative error measure.
Definition: ErrorControl.hpp:106
Options.hpp
Spectral::Swsh::Tags::Eth
Struct for labeling the spin-weighted derivative in tags.
Definition: SwshTags.hpp:30
std::vector
Cce::all_transform_buffer_tags
tmpl::remove_duplicates< tmpl::flatten< tmpl::transform< all_swsh_derivative_tags, tmpl::bind< Spectral::Swsh::coefficient_buffer_tags_for_derivative_tag, tmpl::_1 > >> > all_transform_buffer_tags
A typelist for the full set of coefficient buffers needed to process all of the tags in all_swsh_deri...
Definition: IntegrandInputSteps.hpp:328
Tags::Variables
Definition: VariablesTag.hpp:21
Cce::Tags::BondiBeta
Bondi parameter .
Definition: Tags.hpp:31
Cce::Tags::BondiQ
Bondi parameter .
Definition: Tags.hpp:79
Cce::Tags::TimeIntegral
A prefix tag representing the time integral of the value it prefixes.
Definition: Tags.hpp:348
EvolutionMetavars::factory_creation
Definition: EvolveBurgers.hpp:130
Cce::bondi_hypersurface_step_tags
tmpl::list< Tags::BondiBeta, Tags::BondiQ, Tags::BondiU, Tags::BondiW, Tags::BondiH > bondi_hypersurface_step_tags
Definition: IntegrandInputSteps.hpp:23
Spectral::Swsh::Tags::Derivative
Prefix tag representing the spin-weighted derivative of a spin-weighted scalar.
Definition: SwshTags.hpp:152
disable_openblas_multithreading
void disable_openblas_multithreading() noexcept
Disable OpenBLAS multithreading since it conflicts with Charm++ parallelism.
Cce::Tags::BondiUAtScri
The surface quantity of Bondi evaluated at the null spacetime boundary .
Definition: Tags.hpp:98
EvolutionMetavars
Definition: EvolveBurgers.hpp:103
Cce::Tags::BondiJ
Bondi parameter .
Definition: Tags.hpp:36
Cce::all_boundary_swsh_derivative_tags_for_scri
tmpl::list< Spectral::Swsh::Tags::Derivative< Tags::ComplexInertialRetardedTime, Spectral::Swsh::Tags::EthEth > > all_boundary_swsh_derivative_tags_for_scri
Typelist of steps for SwshDerivatives mutations called on boundary (angular grid only) quantities nee...
Definition: IntegrandInputSteps.hpp:284
enable_floating_point_exceptions
void enable_floating_point_exceptions()
Cce::Tags::InertialRetardedTime
The asymptotically inertial retarded time in terms of the evolution time variable.
Definition: Tags.hpp:170
Cce::Tags::BondiR
The Bondi radius is of the worldtube.
Definition: Tags.hpp:307
Cce::Tags::BoundaryValue
A prefix tag representing the boundary data for a quantity on the extraction surface.
Definition: Tags.hpp:200
tuples::TaggedTuple< Tags... >
Cce::Tags::Du
The derivative with respect to Bondi retarded time .
Definition: Tags.hpp:132
Cce::all_boundary_pre_swsh_derivative_tags_for_scri
tmpl::list< Tags::ComplexInertialRetardedTime > all_boundary_pre_swsh_derivative_tags_for_scri
Typelist of steps for PreSwshDerivatives mutations called on boundary (angular grid only) quantities ...
Definition: IntegrandInputSteps.hpp:278
Cce::Tags::EthInertialRetardedTime
Represents , which is a useful quantity for asymptotic coordinate transformations.
Definition: Tags.hpp:176
Cce::Tags::BondiU
Bondi parameter .
Definition: Tags.hpp:91
Cce::Solutions::WorldtubeData
Abstract base class for analytic worldtube data for verifying the CCE system.
Definition: WorldtubeData.hpp:73
Cce::integrand_terms_to_compute_for_bondi_variable
typename detail::integrand_terms_to_compute_for_bondi_variable_impl< BondiVariable >::type integrand_terms_to_compute_for_bondi_variable
A struct for providing a tmpl::list of integrand tags that need to be computed before integration can...
Definition: Equations.hpp:93
Tags::dt
Prefix indicating a time derivative.
Definition: Prefixes.hpp:29
Cce::Tags::GaugeD
The spin-weight 0 angular Jacobian factor.
Definition: Tags.hpp:143
Cce::CharacteristicEvolution
The component for handling the CCE evolution and waveform output.
Definition: CharacteristicEvolution.hpp:98
Cce::Tags::characteristic_worldtube_boundary_tags
db::wrap_tags_in< BoundaryPrefix, tmpl::list< Tags::BondiBeta, Tags::BondiU, Tags::Dr< Tags::BondiU >, Tags::BondiQ, Tags::BondiW, Tags::BondiJ, Tags::Dr< Tags::BondiJ >, Tags::BondiH, Tags::Du< Tags::BondiJ >, Tags::BondiR, Tags::Du< Tags::BondiR >, Tags::DuRDividedByR > > characteristic_worldtube_boundary_tags
The collection of tags mutated by create_bondi_boundary_data
Definition: BoundaryData.hpp:553
Options::String
const char *const String
The string used in option structs.
Definition: Options.hpp:32
AlgorithmSingleton.hpp
Cce::Tags::DuRDividedByR
The value , where is Bondi radius of the worldtube.
Definition: Tags.hpp:268
Parallel::register_derived_classes_with_charm
void register_derived_classes_with_charm() noexcept
Register derived classes of the Base class.
Definition: RegisterDerivedClassesWithCharm.hpp:35
Blas.hpp
Cce::WorldtubeBufferUpdater
Abstract base class for utilities that are able to perform the buffer updating procedure needed by th...
Definition: WorldtubeBufferUpdater.hpp:145
tt::ConformsTo
Indicate a class conforms to the Protocol.
Definition: ProtocolHelpers.hpp:22
Cce::Tags::GaugeC
The spin-weight 2 angular Jacobian factor.
Definition: Tags.hpp:138
StepChoosers::Increase
Suggests increasing the step size by a constant ratio.
Definition: Increase.hpp:27
Cce::Tags::CauchyCartesianCoords
Definition: Tags.hpp:164
Cce::Tags::ScriPlus
A prefix tag representing the value at .
Definition: Tags.hpp:355
gsl::not_null
Require a pointer to not be a nullptr
Definition: ReadSpecPiecewisePolynomial.hpp:13
Cce::all_pre_swsh_derivative_tags
tmpl::remove_duplicates< tmpl::flatten< tmpl::list< tmpl::transform< bondi_hypersurface_step_tags, tmpl::bind< tmpl::list, pre_swsh_derivative_tags_to_compute_for< tmpl::_1 >, detail::additional_pre_swsh_derivative_tags_for< tmpl::_1 > >>, all_pre_swsh_derivative_tags_for_scri > >> all_pre_swsh_derivative_tags
A typelist for the full set of tags needed as direct or indirect input to any ComputeBondiIntegrand t...
Definition: IntegrandInputSteps.hpp:371
Cce::Tags::Dr
The derivative with respect to Bondi .
Definition: Tags.hpp:125
Cce::Tags::GaugeOmega
The conformal factor associated with an angular transformation.
Definition: Tags.hpp:148