CharacteristicEvolution.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <type_traits>
7 
8 #include "DataStructures/VariablesTag.hpp"
9 #include "Evolution/Systems/Cce/Actions/BoundaryComputeAndSendToEvolution.hpp"
10 #include "Evolution/Systems/Cce/Actions/CalculateScriInputs.hpp"
11 #include "Evolution/Systems/Cce/Actions/CharacteristicEvolutionBondiCalculations.hpp"
12 #include "Evolution/Systems/Cce/Actions/FilterSwshVolumeQuantity.hpp"
13 #include "Evolution/Systems/Cce/Actions/InitializeCharacteristicEvolutionScri.hpp"
14 #include "Evolution/Systems/Cce/Actions/InitializeCharacteristicEvolutionTime.hpp"
15 #include "Evolution/Systems/Cce/Actions/InitializeCharacteristicEvolutionVariables.hpp"
16 #include "Evolution/Systems/Cce/Actions/InitializeFirstHypersurface.hpp"
17 #include "Evolution/Systems/Cce/Actions/InsertInterpolationScriData.hpp"
18 #include "Evolution/Systems/Cce/Actions/RequestBoundaryData.hpp"
19 #include "Evolution/Systems/Cce/Actions/ScriObserveInterpolated.hpp"
20 #include "Evolution/Systems/Cce/Actions/TimeManagement.hpp"
21 #include "Evolution/Systems/Cce/Actions/UpdateGauge.hpp"
22 #include "Evolution/Systems/Cce/LinearSolve.hpp"
23 #include "Evolution/Systems/Cce/PreSwshDerivatives.hpp"
24 #include "Evolution/Systems/Cce/PrecomputeCceDependencies.hpp"
25 #include "Evolution/Systems/Cce/ScriPlusValues.hpp"
26 #include "Evolution/Systems/Cce/SwshDerivatives.hpp"
27 #include "IO/Observer/ObserverComponent.hpp"
28 #include "Parallel/Actions/TerminatePhase.hpp"
30 #include "ParallelAlgorithms/Actions/MutateApply.hpp"
31 #include "ParallelAlgorithms/Initialization/Actions/RemoveOptionsAndTerminatePhase.hpp"
33 #include "Time/Actions/RecordTimeStepperData.hpp"
34 #include "Time/Actions/UpdateU.hpp"
35 #include "Utilities/TMPL.hpp"
36 
37 namespace Cce {
38 
39 /*!
40  * \brief The component for handling the CCE evolution and waveform output.
41  *
42  * \details The \ref DataBoxGroup associated with the CharacteristicEvolution
43  * will contain many spin-weighted volume tags associated with the ongoing CCE
44  * computation, as well as storage for the boundary values and quantities
45  * related to managing the evolution.
46  *
47  * Metavariables requirements:
48  * - Phases:
49  * - `Initialization`
50  * - `Evolve`
51  * - Type aliases:
52  * - `evolved_coordinates_variables_tag`: A `Tags::Variables` with real-valued
53  * tensors associated with coordinates that must be evolved.
54  * - `evolved_swsh_tag`: The spin-weighted quantity to be evolved (typically
55  * `BondiJ`).
56  * - `evolved_swsh_dt_tag`: The spin-weighed quantity associated that is to act
57  * as the time derivative to evolve `evolved_swsh_tag` (typically `BondiH`).
58  * - `cce_boundary_communication_tags`: A typelist of tags that will be
59  * communicated between the worldtube boundary component and the extraction
60  * component (typically
61  * `Cce::Tags::characteristic_worldtube_boundary_tags<Tags::BoundaryValue>`)
62  * - `cce_gauge_boundary_tags`: A typelist of tags that will be derived via
63  * `GaugeAdjustedBoundaryValue` and corresponding gauge utilities
64  * - `cce_integrand_tags`: A typelist of tags needed as inputs to the
65  * linear solve. Obtainable from the metafunction
66  * `Cce::integrand_terms_to_compute_for_bondi_variable`.
67  * - `cce_integration_independent_tags`: A typelist of tags that are to be
68  * computed and stored for each hypersurface iteration, but have no dependencies
69  * on the intermediate hypersurface steps (typically
70  * `Cce::pre_computation_steps`).
71  * - `cce_temporary_equations_tags`: A typelist of temporary buffers maintained
72  * for intermediate steps in the integrand equations. Obtainable from the
73  * metafunction `Cce::integrand_terms_to_compute_for_bondi_variable`.
74  * - `cce_pre_swsh_derivatives_tags`: A typelist of inputs to spin-weighted
75  * derivative calculations to compute and cache for intermediate steps of the
76  * CCE calculation. (typically `Cce::all_pre_swsh_derivative_tags`)
77  * - `cce_swsh_derivative_tags`: A typelist of spin-weighted derivatives to
78  * compute and cache for intermediate steps of the CCE calculation. (typically
79  * `Cce::all_swsh_derivative_tags`)
80  * - `cce_transform_buffer_tags`: A typelist of spin-weighted spherical
81  * harmonic transform modes used to compute the spin-weighted derivatives in the
82  * modal representation. (typically `Cce::all_transform_buffer_tags`).
83  * - `cce_angular_coordinate_tags`: A typelist of real-valued angular
84  * coordinates that are not evolved.
85  * - `cce_scri_tags`: the tags of quantities to compute at scri+
86  * - `cce_hypersurface_initialization`: a mutator (for use with
87  * `::Actions::MutateApply`) that is used to compute the initial hypersurface
88  * data from the boundary data.
89  */
90 template <class Metavariables>
92  using chare_type = Parallel::Algorithms::Singleton;
93  using metavariables = Metavariables;
94 
95  using initialize_action_list =
100  typename Metavariables::cce_boundary_component,
105 
106  using initialization_tags =
108 
109  // the list of actions that occur for each of the hypersurface-integrated
110  // Bondi tags
111  template <typename BondiTag>
112  using hypersurface_computation = tmpl::list<
115  tmpl::transform<integrand_terms_to_compute_for_bondi_variable<BondiTag>,
116  tmpl::bind<::Actions::MutateApply,
117  tmpl::bind<ComputeBondiIntegrand, tmpl::_1>>>,
118  ::Actions::MutateApply<
120  // Once we finish the U computation, we need to update all the quantities
121  // that depend on the time derivative of the gauge
122  tmpl::conditional_t<
123  cpp17::is_same_v<BondiTag, Tags::BondiU>,
124  tmpl::list<
126  ::Actions::MutateApply<
128  ::Actions::MutateApply<PrecomputeCceDependencies<
130  tmpl::list<>>>;
131 
132  using compute_scri_quantities_and_observe = tmpl::list<
133  ::Actions::MutateApply<
136  tmpl::transform<typename metavariables::cce_scri_tags,
137  tmpl::bind<::Actions::MutateApply,
138  tmpl::bind<CalculateScriPlusValue, tmpl::_1>>>,
139  tmpl::transform<
140  typename metavariables::scri_values_to_observe,
141  tmpl::bind<Actions::InsertInterpolationScriData, tmpl::_1>>,
144 
145  using record_time_stepper_data_and_step =
147  typename Metavariables::evolved_coordinates_variables_tag>,
149  tmpl::list<typename Metavariables::evolved_swsh_tag>>>,
151  typename Metavariables::evolved_coordinates_variables_tag>,
153  tmpl::list<typename Metavariables::evolved_swsh_tag>>>,
155 
156  using extract_action_list = tmpl::list<
158  typename Metavariables::cce_boundary_component,
159  CharacteristicEvolution<Metavariables>>,
161  tmpl::transform<bondi_hypersurface_step_tags,
162  tmpl::bind<hypersurface_computation, tmpl::_1>>,
164  compute_scri_quantities_and_observe, record_time_stepper_data_and_step,
166  Actions::ReceiveWorldtubeData<Metavariables>>;
167 
168  using phase_dependent_action_list =
169  tmpl::list<Parallel::PhaseActions<typename Metavariables::Phase,
170  Metavariables::Phase::Initialization,
171  initialize_action_list>,
172  Parallel::PhaseActions<typename Metavariables::Phase,
173  Metavariables::Phase::Evolve,
174  extract_action_list>>;
175 
176  using const_global_cache_tag_list =
178  phase_dependent_action_list>;
179 
180  static void initialize(Parallel::CProxy_ConstGlobalCache<
181  Metavariables>& /*global_cache*/) noexcept {}
182 
183  static void execute_next_phase(
184  const typename Metavariables::Phase next_phase,
185  const Parallel::CProxy_ConstGlobalCache<Metavariables>&
186  global_cache) noexcept {
187  auto& local_cache = *(global_cache.ckLocalBranch());
188  Parallel::get_parallel_component<CharacteristicEvolution<Metavariables>>(
189  local_cache)
190  .start_phase(next_phase);
191  }
192 };
193 } // namespace Cce
Requests boundary data be sent from WorldtubeBoundaryComponent to EvolutionComponent.
Definition: RequestBoundaryData.hpp:84
tmpl::remove_duplicates< tmpl::join< tmpl::transform< ActionsList, detail::get_const_global_cache_tags_from_parallel_struct< tmpl::_1 > >> > get_const_global_cache_tags_from_actions
Given a list of Actions, get a list of the unique tags specified in the actions&#39; const_global_cache_t...
Definition: ParallelComponentHelpers.hpp:66
Definition: VariablesTag.hpp:21
A set of procedures for computing the set of inputs to the CCE integrand computations that can be com...
Definition: PrecomputeCceDependencies.hpp:61
tmpl::remove_duplicates< tmpl::flatten< tmpl::list< AllocationTagsList, tmpl::transform< InitializationActionsList, detail::get_initialization_tags_from_action< tmpl::_1 > >> >> get_initialization_tags
Given a list of initialization actions, and possibly a list of tags needed for allocation of an array...
Definition: ParallelComponentHelpers.hpp:140
The component for handling the CCE evolution and waveform output.
Definition: CharacteristicEvolution.hpp:91
The set of utilities for performing Cauchy characteristic evolution and Cauchy characteristic matchin...
Definition: BoundaryComputeAndSendToEvolution.hpp:28
Perform variable updates for one substep.
Definition: UpdateU.hpp:50
Takes the boundary data needed to perform the CCE linear solves as arguments and puts them in the Dat...
Definition: ReceiveWorldtubeData.hpp:40
Terminates if the current Tags::TimeStepId has time value later or equal to Tags::EndTime.
Definition: TimeManagement.hpp:35
Defines action AdvanceTime.
Definition: ScriPlusValues.hpp:15
Apply the function Mutator::apply to the DataBox.
Definition: MutateApply.hpp:40
Perform all of the computations for dependencies of the hypersurface equations that do not themselves...
Definition: CharacteristicEvolutionBondiCalculations.hpp:63
Checks the interpolation managers and if they are ready, performs the interpolation and sends the dat...
Definition: ScriObserveInterpolated.hpp:70
Given initial boundary data for and , computes the initial hypersurface quantities and gauge values...
Definition: InitializeFirstHypersurface.hpp:38
The nodegroup parallel component that is responsible for writing data to disk.
Definition: ObserverComponent.hpp:48
Calculates the Bondi quantities that are required for any of the CalculateScriPlusValue mutators...
Definition: CalculateScriInputs.hpp:38
The value , where is Bondi radius of the worldtube.
Definition: Tags.hpp:290
Prepare the input quantities in the DataBox for the evaluation of the hypersurface integral used to c...
Definition: CharacteristicEvolutionBondiCalculations.hpp:35
Updates all of the gauge quantities associated with the additional regularity-preserving gauge transf...
Definition: UpdateGauge.hpp:36
Definition: RemoveOptionsAndTerminatePhase.hpp:27
A prefix tag representing the gauge-transformed boundary data for a quantity on the extraction surfac...
Definition: Tags.hpp:215
Initializes the contents of the CharacteristicEvolution component for performing the time evolution o...
Definition: InitializeCharacteristicEvolutionTime.hpp:56
tmpl::list< Tags::BondiBeta, Tags::BondiQ, Tags::BondiU, Tags::BondiW, Tags::BondiH > bondi_hypersurface_step_tags
Definition: IntegrandInputSteps.hpp:23
Records the variables and their time derivatives in the time stepper history.
Definition: RecordTimeStepperData.hpp:50
Initializes the CharacteristicEvolution component with contents needed to perform the interpolation a...
Definition: InitializeCharacteristicEvolutionScri.hpp:39
Filters the spherical volume data stored in BondiTag according to the filter parameters in the Parall...
Definition: FilterSwshVolumeQuantity.hpp:43
Defines action UpdateU.
Wraps the template metaprogramming library used (brigand)
Advance time one substep.
Definition: AdvanceTime.hpp:50
Requests boundary data be sent from WorldtubeBoundaryComponent to EvolutionComponent (template parame...
Definition: RequestBoundaryData.hpp:44
List of all the actions to be executed in the specified phase.
Definition: PhaseDependentActionList.hpp:16
Defines class template ConstGlobalCache.
Computes the evolution gauge on the worldtube.
Definition: GaugeTransformBoundaryData.hpp:104
Computational structs for evaluating the hypersurface integrals during CCE evolution. These are compatible with use in db::mutate_apply.
Definition: LinearSolve.hpp:110
Initializes the main data storage for the CharacteristicEvolution component, which is the singleton t...
Definition: InitializeCharacteristicEvolutionVariables.hpp:61