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 "Evolution/Systems/Cce/Actions/InitializeCharacteristicEvolution.hpp"
9 #include "Parallel/Actions/TerminatePhase.hpp"
11 #include "ParallelAlgorithms/Initialization/Actions/RemoveOptionsAndTerminatePhase.hpp"
13 #include "Utilities/TMPL.hpp"
14 
15 namespace Cce {
16 
17 /*!
18  * \brief The component for handling the CCE evolution and waveform output.
19  *
20  * \details The \ref DataBoxGroup associated with the CharacteristicEvolution
21  * will contain many spin-weighted volume tags associated with the ongoing CCE
22  * computation, as well as storage for the boundary values and quantities
23  * related to managing the evolution.
24  *
25  * Metavariables requirements:
26  * - Phases:
27  * - `Initialization`
28  * - `Evolve`
29  * - Type aliases:
30  * - `evolved_coordinates_variables_tag`: A `Tags::Variables` with real-valued
31  * tensors associated with coordinates that must be evolved.
32  * - `evolved_swsh_tag`: The spin-weighted quantity to be evolved (typically
33  * `BondiJ`).
34  * - `evolved_swsh_dt_tag`: The spin-weighed quantity associated that is to act
35  * as the time derivative to evolve `evolved_swsh_tag` (typically `BondiH`).
36  * - `cce_boundary_communication_tags`: A typelist of tags that will be
37  * communicated between the worldtube boundary component and the extraction
38  * component (typically
39  * `Cce::Tags::characteristic_worldtube_boundary_tags<Tags::BoundaryValue>`)
40  * - `cce_gauge_boundary_tags`: A typelist of tags that will be derived via
41  * `GaugeAdjustedBoundaryValue` and corresponding gauge utilities
42  * - `cce_integrand_tags`: A typelist of tags needed as inputs to the
43  * linear solve. Obtainable from the metafunction
44  * `Cce::integrand_terms_to_compute_for_bondi_variable`.
45  * - `cce_integration_independent_tags`: A typelist of tags that are to be
46  * computed and stored for each hypersurface iteration, but have no dependencies
47  * on the intermediate hypersurface steps (typically
48  * `Cce::pre_computation_steps`).
49  * - `cce_temporary_equations_tags`: A typelist of temporary buffers maintained
50  * for intermediate steps in the integrand equations. Obtainable from the
51  * metafunction `Cce::integrand_terms_to_compute_for_bondi_variable`.
52  * - `cce_pre_swsh_derivatives_tags`: A typelist of inputs to spin-weighted
53  * derivative calculations to compute and cache for intermediate steps of the
54  * CCE calculation. (typically `Cce::all_pre_swsh_derivative_tags`)
55  * - `cce_swsh_derivative_tags`: A typelist of spin-weighted derivatives to
56  * compute and cache for intermediate steps of the CCE calculation. (typically
57  * `Cce::all_swsh_derivative_tags`)
58  * - `cce_transform_buffer_tags`: A typelist of spin-weighted spherical
59  * harmonic transform modes used to compute the spin-weighted derivatives in the
60  * modal representation. (typically `Cce::all_transform_buffer_tags`).
61  * - `cce_angular_coordinate_tags`: A typelist of real-valued angular
62  * coordinates that are not evolved.
63  * - `cce_scri_tags` - the tags of quantities to compute at scri+
64  */
65 template <class Metavariables>
67  using chare_type = Parallel::Algorithms::Singleton;
68  using metavariables = Metavariables;
69 
70  using initialize_action_list =
73 
74  using initialization_tags =
76 
77  using extract_action_list = tmpl::list<::Actions::AdvanceTime>;
78 
79  using phase_dependent_action_list = tmpl::list<
80  Parallel::PhaseActions<typename Metavariables::Phase,
81  Metavariables::Phase::Initialization,
82  initialize_action_list>,
83  Parallel::PhaseActions<typename Metavariables::Phase,
84  Metavariables::Phase::Evolve,
85  extract_action_list>>;
86 
87  using const_global_cache_tag_list =
89  phase_dependent_action_list>;
90 
91  static void initialize(Parallel::CProxy_ConstGlobalCache<
92  Metavariables>& /*global_cache*/) noexcept {}
93 
94  static void execute_next_phase(
95  const typename Metavariables::Phase next_phase,
96  const Parallel::CProxy_ConstGlobalCache<Metavariables>&
97  global_cache) noexcept {
98  auto& local_cache = *(global_cache.ckLocalBranch());
99  if (next_phase == Metavariables::Phase::RegisterWithObserver or
100  next_phase == Metavariables::Phase::Evolve) {
101  Parallel::get_parallel_component<CharacteristicEvolution<Metavariables>>(
102  local_cache)
103  .start_phase(next_phase);
104  }
105  }
106 };
107 } // namespace Cce
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
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:66
Contains functionality for Cauchy Characteristic Extraction.
Definition: BoundaryComputeAndSendToEvolution.hpp:24
Defines action AdvanceTime.
Definition: RemoveOptionsAndTerminatePhase.hpp:27
Wraps the template metaprogramming library used (brigand)
List of all the actions to be executed in the specified phase.
Definition: PhaseDependentActionList.hpp:16
Defines class template ConstGlobalCache.
Initializes the CharacteristicEvolution component, which is the singleton that handles the main evolu...
Definition: InitializeCharacteristicEvolution.hpp:84