WorldtubeBoundary.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include "Evolution/Systems/Cce/Actions/InitializeWorldtubeBoundary.hpp"
7 #include "Evolution/Systems/Cce/BoundaryData.hpp"
8 #include "Parallel/Actions/TerminatePhase.hpp"
10 #include "Parallel/Info.hpp"
11 #include "Parallel/Invoke.hpp"
12 #include "ParallelAlgorithms/Initialization/Actions/RemoveOptionsAndTerminatePhase.hpp"
13 
14 namespace Cce {
15 
16 /*!
17  * \brief Component that supplies CCE worldtube boundary data.
18  *
19  * \details The \ref DataBoxGroup associated with the worldtube boundary
20  * component contains a data manager (e.g. `WorldtubeDataManager`) linked to
21  * an H5 file. The data manager handles buffering and interpolating to desired
22  * target time points when requested via the simple action
23  * `BoundaryComputeAndSendToEvolution`, at which point it will send the required
24  * collection of boundary quantities to the identified 'CharacteristicEvolution'
25  * component. It is assumed that the simple action
26  * `BoundaryComputeAndSendToEvolution` will only be called during the
27  * `Evolve` phase.
28  *
29  * Uses const global tags:
30  * - `Spectral::Swsh::Tags::LMax`
31  *
32  * `Metavariables` must contain:
33  * - the `enum` `Phase` with at least `Initialization` and `Evolve` phases.
34  * - a type alias `cce_boundary_communication_tags` for the set of tags to send
35  * from the worldtube to the evolution component. This will typically be
36  * `Cce::Tags::characteristic_worldtube_boundary_tags<Tags::BoundaryValue>`.
37  */
38 template <class Metavariables>
40  using chare_type = Parallel::Algorithms::Singleton;
41  using metavariables = Metavariables;
42  using initialize_action_list =
45  using initialization_tags =
47 
48  using worldtube_boundary_computation_steps = tmpl::list<>;
49 
50  using phase_dependent_action_list =
51  tmpl::list<Parallel::PhaseActions<typename Metavariables::Phase,
52  Metavariables::Phase::Initialization,
53  initialize_action_list>,
54  Parallel::PhaseActions<typename Metavariables::Phase,
55  Metavariables::Phase::Evolve,
56  worldtube_boundary_computation_steps>>;
57 
58  using const_global_cache_tag_list =
59  Parallel::detail::get_const_global_cache_tags_from_pdal<
60  phase_dependent_action_list>;
61 
62  using options = tmpl::list<>;
63 
64  static void initialize(Parallel::CProxy_ConstGlobalCache<
65  Metavariables>& /*global_cache*/) noexcept {}
66 
67  static void execute_next_phase(
68  const typename Metavariables::Phase next_phase,
69  const Parallel::CProxy_ConstGlobalCache<Metavariables>&
70  global_cache) noexcept {
71  auto& local_cache = *(global_cache.ckLocalBranch());
72  if (next_phase == Metavariables::Phase::Evolve) {
73  Parallel::get_parallel_component<H5WorldtubeBoundary>(local_cache)
74  .perform_algorithm();
75  }
76  }
77 };
78 } // namespace Cce
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
Defines functions for interfacing with the parallelization framework.
Contains functionality for Cauchy Characteristic Extraction.
Definition: BoundaryComputeAndSendToEvolution.hpp:24
Component that supplies CCE worldtube boundary data.
Definition: WorldtubeBoundary.hpp:39
Initializes a H5WorldtubeBoundary.
Definition: InitializeWorldtubeBoundary.hpp:44
Definition: RemoveOptionsAndTerminatePhase.hpp:27
List of all the actions to be executed in the specified phase.
Definition: PhaseDependentActionList.hpp:16
Defines class template ConstGlobalCache.