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/SetupDataBox.hpp"
29 #include "Parallel/Actions/TerminatePhase.hpp"
30 #include "Parallel/GlobalCache.hpp"
31 #include "ParallelAlgorithms/Actions/MutateApply.hpp"
32 #include "ParallelAlgorithms/Initialization/Actions/RemoveOptionsAndTerminatePhase.hpp"
34 #include "Time/Actions/RecordTimeStepperData.hpp"
35 #include "Time/Actions/UpdateU.hpp"
36 #include "Utilities/TMPL.hpp"
37 
38 namespace Cce {
39 
40 /*!
41  * \brief The component for handling the CCE evolution and waveform output.
42  *
43  * \details The \ref DataBoxGroup associated with the CharacteristicEvolution
44  * will contain many spin-weighted volume tags associated with the ongoing CCE
45  * computation, as well as storage for the boundary values and quantities
46  * related to managing the evolution.
47  *
48  * Metavariables requirements:
49  * - Phases:
50  * - `Initialization`
51  * - `Evolve`
52  * - Type aliases:
53  * - `evolved_coordinates_variables_tag`: A `Tags::Variables` with real-valued
54  * tensors associated with coordinates that must be evolved.
55  * - `evolved_swsh_tag`: The spin-weighted quantity to be evolved (typically
56  * `BondiJ`).
57  * - `evolved_swsh_dt_tag`: The spin-weighed quantity associated that is to act
58  * as the time derivative to evolve `evolved_swsh_tag` (typically `BondiH`).
59  * - `cce_boundary_communication_tags`: A typelist of tags that will be
60  * communicated between the worldtube boundary component and the extraction
61  * component (typically
62  * `Cce::Tags::characteristic_worldtube_boundary_tags<Tags::BoundaryValue>`)
63  * - `cce_gauge_boundary_tags`: A typelist of tags that will be derived via
64  * `GaugeAdjustedBoundaryValue` and corresponding gauge utilities
65  * - `cce_integrand_tags`: A typelist of tags needed as inputs to the
66  * linear solve. Obtainable from the metafunction
67  * `Cce::integrand_terms_to_compute_for_bondi_variable`.
68  * - `cce_integration_independent_tags`: A typelist of tags that are to be
69  * computed and stored for each hypersurface iteration, but have no dependencies
70  * on the intermediate hypersurface steps (typically
71  * `Cce::pre_computation_steps`).
72  * - `cce_temporary_equations_tags`: A typelist of temporary buffers maintained
73  * for intermediate steps in the integrand equations. Obtainable from the
74  * metafunction `Cce::integrand_terms_to_compute_for_bondi_variable`.
75  * - `cce_pre_swsh_derivatives_tags`: A typelist of inputs to spin-weighted
76  * derivative calculations to compute and cache for intermediate steps of the
77  * CCE calculation. (typically `Cce::all_pre_swsh_derivative_tags`)
78  * - `cce_swsh_derivative_tags`: A typelist of spin-weighted derivatives to
79  * compute and cache for intermediate steps of the CCE calculation. (typically
80  * `Cce::all_swsh_derivative_tags`)
81  * - `cce_transform_buffer_tags`: A typelist of spin-weighted spherical
82  * harmonic transform modes used to compute the spin-weighted derivatives in the
83  * modal representation. (typically `Cce::all_transform_buffer_tags`).
84  * - `cce_angular_coordinate_tags`: A typelist of real-valued angular
85  * coordinates that are not evolved.
86  * - `cce_scri_tags`: the tags of quantities to compute at scri+
87  * - `cce_hypersurface_initialization`: a mutator (for use with
88  * `::Actions::MutateApply`) that is used to compute the initial hypersurface
89  * data from the boundary data.
90  */
91 template <class Metavariables>
94  using metavariables = Metavariables;
95 
96  using initialize_action_list = tmpl::list<
100  typename Metavariables::evolved_coordinates_variables_tag,
101  typename Metavariables::evolved_swsh_tag>,
103  typename Metavariables::scri_values_to_observe>,
105  typename Metavariables::cce_boundary_component,
110 
111  using initialization_tags =
113 
114  // the list of actions that occur for each of the hypersurface-integrated
115  // Bondi tags
116  template <typename BondiTag>
117  using hypersurface_computation = tmpl::list<
120  tmpl::transform<integrand_terms_to_compute_for_bondi_variable<BondiTag>,
121  tmpl::bind<::Actions::MutateApply,
122  tmpl::bind<ComputeBondiIntegrand, tmpl::_1>>>,
125  // Once we finish the U computation, we need to update all the quantities
126  // that depend on the time derivative of the gauge
127  tmpl::conditional_t<
128  std::is_same_v<BondiTag, Tags::BondiU>,
129  tmpl::list<
135  tmpl::list<>>>;
136 
137  using compute_scri_quantities_and_observe = tmpl::list<
141  tmpl::transform<typename metavariables::cce_scri_tags,
142  tmpl::bind<::Actions::MutateApply,
143  tmpl::bind<CalculateScriPlusValue, tmpl::_1>>>,
144  tmpl::transform<
145  typename metavariables::scri_values_to_observe,
146  tmpl::bind<Actions::InsertInterpolationScriData, tmpl::_1>>,
149 
150  using record_time_stepper_data_and_step =
152  typename Metavariables::evolved_coordinates_variables_tag>,
154  tmpl::list<typename Metavariables::evolved_swsh_tag>>>,
156  typename Metavariables::evolved_coordinates_variables_tag>,
158  tmpl::list<typename Metavariables::evolved_swsh_tag>>>,
160 
161  using extract_action_list = tmpl::list<
163  typename Metavariables::cce_boundary_component,
166  tmpl::transform<bondi_hypersurface_step_tags,
167  tmpl::bind<hypersurface_computation, tmpl::_1>>,
169  compute_scri_quantities_and_observe, record_time_stepper_data_and_step,
172 
173  using phase_dependent_action_list =
174  tmpl::list<Parallel::PhaseActions<typename Metavariables::Phase,
175  Metavariables::Phase::Initialization,
176  initialize_action_list>,
177  Parallel::PhaseActions<typename Metavariables::Phase,
178  Metavariables::Phase::Evolve,
179  extract_action_list>>;
180 
181  using const_global_cache_tag_list =
183  phase_dependent_action_list>;
184 
185  static void initialize(Parallel::CProxy_GlobalCache<
186  Metavariables>& /*global_cache*/) noexcept {}
187 
188  static void execute_next_phase(
189  const typename Metavariables::Phase next_phase,
190  const Parallel::CProxy_GlobalCache<Metavariables>&
191  global_cache) noexcept {
192  auto& local_cache = *(global_cache.ckLocalBranch());
193  Parallel::get_parallel_component<CharacteristicEvolution<Metavariables>>(
194  local_cache)
195  .start_phase(next_phase);
196  }
197 };
198 } // namespace Cce
Cce::Actions::RequestNextBoundaryData
Requests boundary data be sent from WorldtubeBoundaryComponent to EvolutionComponent.
Definition: RequestBoundaryData.hpp:84
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:81
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:88
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:43
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:102
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:252
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:38
Actions::MutateApply
Apply the function Mutator::apply to the DataBox.
Definition: MutateApply.hpp:40
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:49
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: BoundaryComputeAndSendToEvolution.hpp:28
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:92
Actions::UpdateU
Perform variable updates for one substep.
Definition: UpdateU.hpp:49
Cce::Tags::DuRDividedByR
The value , where is Bondi radius of the worldtube.
Definition: Tags.hpp:266
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