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 "Evolution/Systems/Cce/System.hpp"
28 #include "IO/Observer/ObserverComponent.hpp"
29 #include "Parallel/Actions/Goto.hpp"
30 #include "Parallel/Actions/SetupDataBox.hpp"
31 #include "Parallel/Actions/TerminatePhase.hpp"
32 #include "Parallel/GlobalCache.hpp"
33 #include "ParallelAlgorithms/Actions/MutateApply.hpp"
34 #include "ParallelAlgorithms/Initialization/Actions/RemoveOptionsAndTerminatePhase.hpp"
36 #include "Time/Actions/ChangeStepSize.hpp"
37 #include "Time/Actions/RecordTimeStepperData.hpp"
38 #include "Time/Actions/SelfStartActions.hpp"
39 #include "Time/Actions/UpdateU.hpp"
40 #include "Utilities/TMPL.hpp"
41 
42 namespace Cce {
43 
45 
46 /*!
47  * \brief The component for handling the CCE evolution and waveform output.
48  *
49  * \details The \ref DataBoxGroup associated with the CharacteristicEvolution
50  * will contain many spin-weighted volume tags associated with the ongoing CCE
51  * computation, as well as storage for the boundary values and quantities
52  * related to managing the evolution.
53  *
54  * Metavariables requirements:
55  * - Phases:
56  * - `Initialization`
57  * - `Evolve`
58  * - Type aliases:
59  * - `evolved_coordinates_variables_tag`: A `Tags::Variables` with real-valued
60  * tensors associated with coordinates that must be evolved.
61  * - `evolved_swsh_tag`: The spin-weighted quantity to be evolved (typically
62  * `BondiJ`).
63  * - `evolved_swsh_dt_tag`: The spin-weighed quantity associated that is to act
64  * as the time derivative to evolve `evolved_swsh_tag` (typically `BondiH`).
65  * - `cce_boundary_communication_tags`: A typelist of tags that will be
66  * communicated between the worldtube boundary component and the extraction
67  * component (typically
68  * `Cce::Tags::characteristic_worldtube_boundary_tags<Tags::BoundaryValue>`)
69  * - `cce_gauge_boundary_tags`: A typelist of tags that will be derived via
70  * `GaugeAdjustedBoundaryValue` and corresponding gauge utilities
71  * - `cce_integrand_tags`: A typelist of tags needed as inputs to the
72  * linear solve. Obtainable from the metafunction
73  * `Cce::integrand_terms_to_compute_for_bondi_variable`.
74  * - `cce_integration_independent_tags`: A typelist of tags that are to be
75  * computed and stored for each hypersurface iteration, but have no dependencies
76  * on the intermediate hypersurface steps (typically
77  * `Cce::pre_computation_steps`).
78  * - `cce_temporary_equations_tags`: A typelist of temporary buffers maintained
79  * for intermediate steps in the integrand equations. Obtainable from the
80  * metafunction `Cce::integrand_terms_to_compute_for_bondi_variable`.
81  * - `cce_pre_swsh_derivatives_tags`: A typelist of inputs to spin-weighted
82  * derivative calculations to compute and cache for intermediate steps of the
83  * CCE calculation. (typically `Cce::all_pre_swsh_derivative_tags`)
84  * - `cce_swsh_derivative_tags`: A typelist of spin-weighted derivatives to
85  * compute and cache for intermediate steps of the CCE calculation. (typically
86  * `Cce::all_swsh_derivative_tags`)
87  * - `cce_transform_buffer_tags`: A typelist of spin-weighted spherical
88  * harmonic transform modes used to compute the spin-weighted derivatives in the
89  * modal representation. (typically `Cce::all_transform_buffer_tags`).
90  * - `cce_angular_coordinate_tags`: A typelist of real-valued angular
91  * coordinates that are not evolved.
92  * - `cce_scri_tags`: the tags of quantities to compute at scri+
93  * - `cce_hypersurface_initialization`: a mutator (for use with
94  * `::Actions::MutateApply`) that is used to compute the initial hypersurface
95  * data from the boundary data.
96  */
97 template <class Metavariables>
100  using metavariables = Metavariables;
101 
102  using initialize_action_list = tmpl::list<
106  typename Metavariables::evolved_coordinates_variables_tag,
107  typename Metavariables::evolved_swsh_tag,
108  Metavariables::local_time_stepping>,
110  typename Metavariables::scri_values_to_observe,
111  typename Metavariables::cce_boundary_component>,
113 
114  using initialization_tags =
116 
117  // the list of actions that occur for each of the hypersurface-integrated
118  // Bondi tags
119  template <typename BondiTag>
120  using hypersurface_computation = tmpl::list<
123  tmpl::transform<integrand_terms_to_compute_for_bondi_variable<BondiTag>,
124  tmpl::bind<::Actions::MutateApply,
125  tmpl::bind<ComputeBondiIntegrand, tmpl::_1>>>,
128  // Once we finish the U computation, we need to update all the quantities
129  // that depend on the time derivative of the gauge
130  tmpl::conditional_t<
131  std::is_same_v<BondiTag, Tags::BondiU>,
132  tmpl::list<
138  tmpl::list<>>>;
139 
140  using compute_scri_quantities_and_observe = tmpl::list<
144  tmpl::transform<typename metavariables::cce_scri_tags,
145  tmpl::bind<::Actions::MutateApply,
146  tmpl::bind<CalculateScriPlusValue, tmpl::_1>>>,
147  tmpl::transform<
148  typename metavariables::scri_values_to_observe,
149  tmpl::bind<
151  tmpl::pin<typename Metavariables::cce_boundary_component>>>,
154  typename Metavariables::cce_boundary_component>>;
155 
156  using record_time_stepper_data_and_step =
158  typename Metavariables::evolved_coordinates_variables_tag>,
160  tmpl::list<typename Metavariables::evolved_swsh_tag>>>,
162  typename Metavariables::evolved_coordinates_variables_tag>,
164  tmpl::list<typename Metavariables::evolved_swsh_tag>>>>;
165 
166  using self_start_extract_action_list = tmpl::list<
168  typename Metavariables::cce_boundary_component,
171  // note that the initialization will only actually happen on the
172  // iterations immediately following restarts
175  tmpl::transform<bondi_hypersurface_step_tags,
176  tmpl::bind<hypersurface_computation, tmpl::_1>>,
181  tmpl::transform<typename metavariables::cce_scri_tags,
182  tmpl::bind<::Actions::MutateApply,
183  tmpl::bind<CalculateScriPlusValue, tmpl::_1>>>,
184  record_time_stepper_data_and_step>;
185 
186  using extract_action_list = tmpl::list<
188  typename Metavariables::cce_boundary_component,
194  tmpl::transform<bondi_hypersurface_step_tags,
195  tmpl::bind<hypersurface_computation, tmpl::_1>>,
197  compute_scri_quantities_and_observe, record_time_stepper_data_and_step,
199  // We cannot know our next step for certain until after we've performed
200  // step size selection, as we may need to reject a step.
202  typename Metavariables::cce_boundary_component,
207 
208  using phase_dependent_action_list = tmpl::list<
209  Parallel::PhaseActions<typename Metavariables::Phase,
210  Metavariables::Phase::Initialization,
211  initialize_action_list>,
212  Parallel::PhaseActions<typename Metavariables::Phase,
213  Metavariables::Phase::InitializeTimeStepperHistory,
215  self_start_extract_action_list, Cce::System>>,
216  Parallel::PhaseActions<typename Metavariables::Phase,
217  Metavariables::Phase::Evolve,
218  extract_action_list>>;
219 
220  static void initialize(
221  Parallel::CProxy_GlobalCache<Metavariables>& /*global_cache*/) noexcept {}
222 
223  static void execute_next_phase(
224  const typename Metavariables::Phase next_phase,
225  const Parallel::CProxy_GlobalCache<Metavariables>&
226  global_cache) noexcept {
227  auto& local_cache = *(global_cache.ckLocalBranch());
228  Parallel::get_parallel_component<CharacteristicEvolution<Metavariables>>(
229  local_cache)
230  .start_phase(next_phase);
231  }
232 };
233 } // namespace Cce
Cce::Actions::RequestNextBoundaryData
Requests boundary data be sent from WorldtubeBoundaryComponent to EvolutionComponent.
Definition: RequestBoundaryData.hpp:84
Actions::Goto
Definition: Goto.hpp:69
Cce::CalculateScriPlusValue
Definition: ScriPlusValues.hpp:24
Actions::SetupDataBox
Add into the DataBox default constructed items for the collection of tags requested by any of the act...
Definition: SetupDataBox.hpp:102
Cce::System
Definition: System.hpp:116
Cce::Actions::InitializeCharacteristicEvolutionTime
Initializes the contents of the CharacteristicEvolution component for performing the time evolution o...
Definition: InitializeCharacteristicEvolutionTime.hpp:63
GlobalCache.hpp
Cce::Actions::ReceiveWorldtubeData
Takes the boundary data needed to perform the CCE linear solves as arguments and puts them in the Dat...
Definition: ReceiveWorldtubeData.hpp:41
Cce::Actions::RequestBoundaryData
Requests boundary data be sent from WorldtubeBoundaryComponent to EvolutionComponent (template parame...
Definition: RequestBoundaryData.hpp:44
Tags::Variables
Definition: VariablesTag.hpp:21
Cce::Actions::InitializeCharacteristicEvolutionScri
Initializes the CharacteristicEvolution component with contents needed to perform the interpolation a...
Definition: InitializeCharacteristicEvolutionScri.hpp:49
Initialization::Actions::RemoveOptionsAndTerminatePhase
Definition: RemoveOptionsAndTerminatePhase.hpp:27
Cce::PrecomputeCceDependencies
A set of procedures for computing the set of inputs to the CCE integrand computations that can be com...
Definition: PrecomputeCceDependencies.hpp:61
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
Actions::AdvanceTime
Advance time one substep.
Definition: AdvanceTime.hpp:50
Cce::RadialIntegrateBondi
Computational structs for evaluating the hypersurface integrals during CCE evolution....
Definition: LinearSolve.hpp:109
Cce::Actions::ScriObserveInterpolated
Checks the interpolation managers and if they are ready, performs the interpolation and sends the dat...
Definition: ScriObserveInterpolated.hpp:109
Parallel::get_initialization_tags
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:254
Cce::Actions::ExitIfEndTimeReached
Terminates if the current Tags::TimeStepId has time value later or equal to Tags::EndTime.
Definition: TimeManagement.hpp:35
Cce::Actions::CalculateIntegrandInputsForTag
Prepare the input quantities in the DataBox for the evaluation of the hypersurface integral used to c...
Definition: CharacteristicEvolutionBondiCalculations.hpp:35
Parallel::PhaseActions
List of all the actions to be executed in the specified phase.
Definition: PhaseDependentActionList.hpp:16
observers::ObserverWriter
The nodegroup parallel component that is responsible for writing data to disk.
Definition: ObserverComponent.hpp:51
Cce::Actions::CalculateScriInputs
Calculates the Bondi quantities that are required for any of the CalculateScriPlusValue mutators.
Definition: CalculateScriInputs.hpp:38
Cce::Actions::InitializeFirstHypersurface
Given initial boundary data for and , computes the initial hypersurface quantities and gauge values...
Definition: InitializeFirstHypersurface.hpp:44
Actions::MutateApply
Apply the function Mutator::apply to the DataBox.
Definition: MutateApply.hpp:40
Cce::CceEvolutionLabelTag
Definition: CharacteristicEvolution.hpp:44
Actions::ChangeStepSize
Adjust the step size for local time stepping.
Definition: ChangeStepSize.hpp:131
Cce::Actions::UpdateGauge
Updates all of the gauge quantities associated with the additional regularity-preserving gauge transf...
Definition: UpdateGauge.hpp:36
Cce::Actions::PrecomputeGlobalCceDependencies
Perform all of the computations for dependencies of the hypersurface equations that do not themselves...
Definition: CharacteristicEvolutionBondiCalculations.hpp:63
AdvanceTime.hpp
SelfStart::self_start_procedure
tmpl::flatten< tmpl::list< SelfStart::Actions::Initialize< System >, ::Actions::Label< detail::PhaseStart >, SelfStart::Actions::CheckForCompletion< detail::PhaseEnd, System >, ::Actions::AdvanceTime, SelfStart::Actions::CheckForOrderIncrease, StepActions, ::Actions::Goto< detail::PhaseStart >, ::Actions::Label< detail::PhaseEnd >, SelfStart::Actions::Cleanup, ::Actions::AdvanceTime, Parallel::Actions::TerminatePhase > > self_start_procedure
Definition: SelfStartActions.hpp:471
Actions::RecordTimeStepperData
Records the variables and their time derivatives in the time stepper history.
Definition: RecordTimeStepperData.hpp:77
Parallel::Algorithms::Singleton
A struct that stores the charm++ types relevant for a particular singleton component.
Definition: AlgorithmSingletonDeclarations.hpp:29
Cce
The set of utilities for performing Cauchy characteristic evolution and Cauchy characteristic matchin...
Definition: CharacteristicExtractFwd.hpp:6
Cce::Actions::FilterSwshVolumeQuantity
Filters the spherical volume data stored in BondiTag according to the filter parameters in the Parall...
Definition: FilterSwshVolumeQuantity.hpp:43
Cce::CharacteristicEvolution
The component for handling the CCE evolution and waveform output.
Definition: CharacteristicEvolution.hpp:98
Actions::UpdateU
Perform variable updates for one substep.
Definition: UpdateU.hpp:96
Cce::Actions::InsertInterpolationScriData
Places the data from the current hypersurface necessary to compute Tag in the ScriPlusInterpolationMa...
Definition: InsertInterpolationScriData.hpp:126
Cce::Tags::DuRDividedByR
The value , where is Bondi radius of the worldtube.
Definition: Tags.hpp:268
Actions::Label
Definition: Goto.hpp:38
UpdateU.hpp
Cce::Actions::InitializeCharacteristicEvolutionVariables
Initializes the main data storage for the CharacteristicEvolution component, which is the singleton t...
Definition: InitializeCharacteristicEvolutionVariables.hpp:66
Cce::Tags::EvolutionGaugeBoundaryValue
A prefix tag representing the gauge-transformed boundary data for a quantity on the extraction surfac...
Definition: Tags.hpp:208
type_traits
TMPL.hpp
Cce::GaugeAdjustedBoundaryValue< Tags::DuRDividedByR >
Computes the evolution gauge on the worldtube.
Definition: GaugeTransformBoundaryData.hpp:103