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/Goto.hpp"
29 #include "Parallel/Actions/SetupDataBox.hpp"
30 #include "Parallel/Actions/TerminatePhase.hpp"
31 #include "Parallel/GlobalCache.hpp"
32 #include "ParallelAlgorithms/Actions/MutateApply.hpp"
33 #include "ParallelAlgorithms/Initialization/Actions/RemoveOptionsAndTerminatePhase.hpp"
35 #include "Time/Actions/RecordTimeStepperData.hpp"
36 #include "Time/Actions/UpdateU.hpp"
37 #include "Utilities/TMPL.hpp"
38 
39 namespace Cce {
40 
42 
43 /*!
44  * \brief The component for handling the CCE evolution and waveform output.
45  *
46  * \details The \ref DataBoxGroup associated with the CharacteristicEvolution
47  * will contain many spin-weighted volume tags associated with the ongoing CCE
48  * computation, as well as storage for the boundary values and quantities
49  * related to managing the evolution.
50  *
51  * Metavariables requirements:
52  * - Phases:
53  * - `Initialization`
54  * - `Evolve`
55  * - Type aliases:
56  * - `evolved_coordinates_variables_tag`: A `Tags::Variables` with real-valued
57  * tensors associated with coordinates that must be evolved.
58  * - `evolved_swsh_tag`: The spin-weighted quantity to be evolved (typically
59  * `BondiJ`).
60  * - `evolved_swsh_dt_tag`: The spin-weighed quantity associated that is to act
61  * as the time derivative to evolve `evolved_swsh_tag` (typically `BondiH`).
62  * - `cce_boundary_communication_tags`: A typelist of tags that will be
63  * communicated between the worldtube boundary component and the extraction
64  * component (typically
65  * `Cce::Tags::characteristic_worldtube_boundary_tags<Tags::BoundaryValue>`)
66  * - `cce_gauge_boundary_tags`: A typelist of tags that will be derived via
67  * `GaugeAdjustedBoundaryValue` and corresponding gauge utilities
68  * - `cce_integrand_tags`: A typelist of tags needed as inputs to the
69  * linear solve. Obtainable from the metafunction
70  * `Cce::integrand_terms_to_compute_for_bondi_variable`.
71  * - `cce_integration_independent_tags`: A typelist of tags that are to be
72  * computed and stored for each hypersurface iteration, but have no dependencies
73  * on the intermediate hypersurface steps (typically
74  * `Cce::pre_computation_steps`).
75  * - `cce_temporary_equations_tags`: A typelist of temporary buffers maintained
76  * for intermediate steps in the integrand equations. Obtainable from the
77  * metafunction `Cce::integrand_terms_to_compute_for_bondi_variable`.
78  * - `cce_pre_swsh_derivatives_tags`: A typelist of inputs to spin-weighted
79  * derivative calculations to compute and cache for intermediate steps of the
80  * CCE calculation. (typically `Cce::all_pre_swsh_derivative_tags`)
81  * - `cce_swsh_derivative_tags`: A typelist of spin-weighted derivatives to
82  * compute and cache for intermediate steps of the CCE calculation. (typically
83  * `Cce::all_swsh_derivative_tags`)
84  * - `cce_transform_buffer_tags`: A typelist of spin-weighted spherical
85  * harmonic transform modes used to compute the spin-weighted derivatives in the
86  * modal representation. (typically `Cce::all_transform_buffer_tags`).
87  * - `cce_angular_coordinate_tags`: A typelist of real-valued angular
88  * coordinates that are not evolved.
89  * - `cce_scri_tags`: the tags of quantities to compute at scri+
90  * - `cce_hypersurface_initialization`: a mutator (for use with
91  * `::Actions::MutateApply`) that is used to compute the initial hypersurface
92  * data from the boundary data.
93  */
94 template <class Metavariables>
97  using metavariables = Metavariables;
98 
99  using initialize_action_list = tmpl::list<
103  typename Metavariables::evolved_coordinates_variables_tag,
104  typename Metavariables::evolved_swsh_tag>,
106  typename Metavariables::scri_values_to_observe,
107  typename Metavariables::cce_boundary_component>,
109 
110  using initialization_tags =
112 
113  // the list of actions that occur for each of the hypersurface-integrated
114  // Bondi tags
115  template <typename BondiTag>
116  using hypersurface_computation = tmpl::list<
119  tmpl::transform<integrand_terms_to_compute_for_bondi_variable<BondiTag>,
120  tmpl::bind<::Actions::MutateApply,
121  tmpl::bind<ComputeBondiIntegrand, tmpl::_1>>>,
124  // Once we finish the U computation, we need to update all the quantities
125  // that depend on the time derivative of the gauge
126  tmpl::conditional_t<
127  std::is_same_v<BondiTag, Tags::BondiU>,
128  tmpl::list<
134  tmpl::list<>>>;
135 
136  using compute_scri_quantities_and_observe = tmpl::list<
140  tmpl::transform<typename metavariables::cce_scri_tags,
141  tmpl::bind<::Actions::MutateApply,
142  tmpl::bind<CalculateScriPlusValue, tmpl::_1>>>,
143  tmpl::transform<
144  typename metavariables::scri_values_to_observe,
145  tmpl::bind<
147  tmpl::pin<typename Metavariables::cce_boundary_component>>>,
150  typename Metavariables::cce_boundary_component>>;
151 
152  using record_time_stepper_data_and_step =
154  typename Metavariables::evolved_coordinates_variables_tag>,
156  tmpl::list<typename Metavariables::evolved_swsh_tag>>>,
158  typename Metavariables::evolved_coordinates_variables_tag>,
160  tmpl::list<typename Metavariables::evolved_swsh_tag>>>,
162 
163  using extract_action_list = tmpl::list<
165  typename Metavariables::cce_boundary_component,
171  typename Metavariables::cce_boundary_component,
174  tmpl::transform<bondi_hypersurface_step_tags,
175  tmpl::bind<hypersurface_computation, tmpl::_1>>,
177  compute_scri_quantities_and_observe, record_time_stepper_data_and_step,
181 
182  using phase_dependent_action_list =
183  tmpl::list<Parallel::PhaseActions<typename Metavariables::Phase,
184  Metavariables::Phase::Initialization,
185  initialize_action_list>,
186  Parallel::PhaseActions<typename Metavariables::Phase,
187  Metavariables::Phase::Evolve,
188  extract_action_list>>;
189 
190  using const_global_cache_tag_list =
192  phase_dependent_action_list>;
193 
194  static void initialize(Parallel::CProxy_GlobalCache<
195  Metavariables>& /*global_cache*/) noexcept {}
196 
197  static void execute_next_phase(
198  const typename Metavariables::Phase next_phase,
199  const Parallel::CProxy_GlobalCache<Metavariables>&
200  global_cache) noexcept {
201  auto& local_cache = *(global_cache.ckLocalBranch());
202  Parallel::get_parallel_component<CharacteristicEvolution<Metavariables>>(
203  local_cache)
204  .start_phase(next_phase);
205  }
206 };
207 } // 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::Actions::InitializeCharacteristicEvolutionTime
Initializes the contents of the CharacteristicEvolution component for performing the time evolution o...
Definition: InitializeCharacteristicEvolutionTime.hpp:60
GlobalCache.hpp
Parallel::get_const_global_cache_tags_from_actions
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' const_global_cache_t...
Definition: ParallelComponentHelpers.hpp:89
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:40
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:41
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
Actions::RecordTimeStepperData
Records the variables and their time derivatives in the time stepper history.
Definition: RecordTimeStepperData.hpp:76
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:95
Actions::UpdateU
Perform variable updates for one substep.
Definition: UpdateU.hpp:72
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:266
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:65
Cce::Tags::EvolutionGaugeBoundaryValue
A prefix tag representing the gauge-transformed boundary data for a quantity on the extraction surfac...
Definition: Tags.hpp:206
type_traits
TMPL.hpp
Cce::GaugeAdjustedBoundaryValue< Tags::DuRDividedByR >
Computes the evolution gauge on the worldtube.
Definition: GaugeTransformBoundaryData.hpp:103