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/SetupDataBox.hpp"
9 #include "Parallel/Actions/TerminatePhase.hpp"
10 #include "Parallel/GlobalCache.hpp"
11 #include "Parallel/Invoke.hpp"
12 #include "ParallelAlgorithms/Initialization/Actions/RemoveOptionsAndTerminatePhase.hpp"
13 
14 namespace Cce {
15 
16 /*!
17  * \brief Generic base class for components that supply CCE worldtube boundary
18  * data. See class specializations for specific worldtube boundary components.
19  */
20 template <typename WorldtubeComponent, typename Metavariables>
23  using metavariables = Metavariables;
24  using initialize_action_list =
25  tmpl::list<::Actions::SetupDataBox,
28 
29  using initialization_tags =
31 
32  using worldtube_boundary_computation_steps = tmpl::list<>;
33 
34  using phase_dependent_action_list =
35  tmpl::list<Parallel::PhaseActions<typename Metavariables::Phase,
36  Metavariables::Phase::Initialization,
37  initialize_action_list>,
38  Parallel::PhaseActions<typename Metavariables::Phase,
39  Metavariables::Phase::Evolve,
40  worldtube_boundary_computation_steps>>;
41 
42  using const_global_cache_tag_list =
43  Parallel::detail::get_const_global_cache_tags_from_pdal<
44  phase_dependent_action_list>;
45 
46  using options = tmpl::list<>;
47 
48  static void initialize(Parallel::CProxy_GlobalCache<
49  Metavariables>& /*global_cache*/) noexcept {}
50 
51  static void execute_next_phase(
52  const typename Metavariables::Phase next_phase,
53  const Parallel::CProxy_GlobalCache<Metavariables>&
54  global_cache) noexcept {
55  auto& local_cache = *(global_cache.ckLocalBranch());
56  if (next_phase == Metavariables::Phase::Evolve) {
57  Parallel::get_parallel_component<WorldtubeComponent>(local_cache)
58  .start_phase(next_phase);
59  }
60  }
61 };
62 
63 /*!
64  * \brief Component that supplies CCE worldtube boundary data.
65  *
66  * \details The \ref DataBoxGroup associated with the worldtube boundary
67  * component contains a data manager (e.g. `WorldtubeDataManager`) linked to
68  * an H5 file. The data manager handles buffering and interpolating to desired
69  * target time points when requested via the simple action
70  * `BoundaryComputeAndSendToEvolution`, at which point it will send the required
71  * collection of boundary quantities to the identified 'CharacteristicEvolution'
72  * component. It is assumed that the simple action
73  * `BoundaryComputeAndSendToEvolution` will only be called during the
74  * `Evolve` phase.
75  *
76  * Uses const global tags:
77  * - `Tags::LMax`
78  *
79  * `Metavariables` must contain:
80  * - the `enum` `Phase` with at least `Initialization` and `Evolve` phases.
81  * - a type alias `cce_boundary_communication_tags` for the set of tags to send
82  * from the worldtube to the evolution component. This will typically be
83  * `Cce::Tags::characteristic_worldtube_boundary_tags<Tags::BoundaryValue>`.
84  */
85 template <class Metavariables>
87  : public WorldtubeComponentBase<H5WorldtubeBoundary<Metavariables>,
88  Metavariables> {
89  using base_type =
91  using base_type::execute_next_phase;
92  using base_type::initialize;
93  using typename base_type::chare_type;
94  using typename base_type::const_global_cache_tag_list;
95  using typename base_type::initialization_tags;
96  using typename base_type::metavariables;
97  using typename base_type::options;
98  using typename base_type::phase_dependent_action_list;
100 };
101 
102 /*!
103  * \brief Component that supplies CCE worldtube boundary data sourced from an
104  * analytic solution.
105  *
106  * \details The \ref DataBoxGroup associated with the worldtube boundary
107  * component contains a data manager (e.g. `AnalyticBoundaryDataManager`) that
108  * contains the analytic solution being provided. The data manager handles
109  * computation of the analytic solution boundary data when requested via
110  * the simple action `BoundaryComputeAndSendToEvolution`, at which point it will
111  * send the required collection of boundary quantities to the identified
112  * 'CharacteristicEvolution' component. It is assumed that the simple action
113  * `BoundaryComputeAndSendToEvolution` will only be called during the
114  * `Evolve` phase.
115  *
116  * Uses const global tags:
117  * - `Tags::LMax`
118  * - `Tags::SpecifiedEndTime`
119  *
120  * `Metavariables` must contain:
121  * - the `enum` `Phase` with at least `Initialization` and `Evolve` phases.
122  * - a type alias `cce_boundary_communication_tags` for the set of tags to send
123  * from the worldtube to the evolution component. This will typically be
124  * `Cce::Tags::characteristic_worldtube_boundary_tags<Tags::BoundaryValue>`.
125  */
126 template <class Metavariables>
128  : public WorldtubeComponentBase<AnalyticWorldtubeBoundary<Metavariables>,
129  Metavariables> {
130  using base_type =
132  Metavariables>;
133  using base_type::execute_next_phase;
134  using base_type::initialize;
135  using typename base_type::chare_type;
136  using typename base_type::const_global_cache_tag_list;
137  using typename base_type::initialization_tags;
138  using typename base_type::metavariables;
139  using typename base_type::options;
140  using typename base_type::phase_dependent_action_list;
142 };
143 
144 /*!
145  * \brief Component that supplies CCE worldtube boundary data sourced from a
146  * running GH system.
147  *
148  * \details The \ref DataBoxGroup associated with the worldtube boundary
149  * component contains an interface manager (derived from
150  * `Cce::GhWorldtubeInterfaceManager`) that stores and provides the data
151  * received from the GH system. The data manager handles buffering
152  * and interpolating to desired target time points when requested via the simple
153  * action `Cce::Actions::BoundaryComputeAndSendToEvolution`, at which point it
154  * will send the required collection of boundary quantities to the identified
155  * `CharacteristicEvolution` component. It is assumed that the simple action
156  * `Cce::Actions::BoundaryComputeAndSendToEvolution` will only be called during
157  * the `Evolve` phase.
158  *
159  * Uses const global tags:
160  * - `InitializationTags::LMax`
161  * - `InitializationTags::ExtractionRadius`
162  *
163  * `Metavariables` must contain:
164  * - the `enum` `Phase` with at least `Initialization` and `Evolve` phases.
165  * - a type alias `cce_boundary_communication_tags` for the set of tags to send
166  * from the worldtube to the evolution component. This will typically be
167  * `Cce::Tags::characteristic_worldtube_boundary_tags<Tags::BoundaryValue>`.
168  */
169 template <class Metavariables>
171  : public WorldtubeComponentBase<GhWorldtubeBoundary<Metavariables>,
172  Metavariables> {
173  using base_type =
175  using base_type::execute_next_phase;
176  using base_type::initialize;
177  using typename base_type::chare_type;
178  using typename base_type::const_global_cache_tag_list;
179  using typename base_type::initialization_tags;
180  using typename base_type::metavariables;
181  using typename base_type::options;
182  using typename base_type::phase_dependent_action_list;
184 };
185 } // namespace Cce
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::WorldtubeComponentBase
Generic base class for components that supply CCE worldtube boundary data. See class specializations ...
Definition: WorldtubeBoundary.hpp:21
GlobalCache.hpp
Initialization::Actions::RemoveOptionsAndTerminatePhase
Definition: RemoveOptionsAndTerminatePhase.hpp:27
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::AnalyticWorldtubeBoundary
Component that supplies CCE worldtube boundary data sourced from an analytic solution.
Definition: WorldtubeBoundary.hpp:127
Cce::Tags::SpecifiedEndTime
Represents the final time of a bounded CCE evolution that must be supplied in the input file (for e....
Definition: OptionTags.hpp:444
Parallel::PhaseActions
List of all the actions to be executed in the specified phase.
Definition: PhaseDependentActionList.hpp:16
Cce::H5WorldtubeBoundary
Component that supplies CCE worldtube boundary data.
Definition: WorldtubeBoundary.hpp:86
Cce::Tags::NoEndTime
Represents the final time of a CCE evolution that should just proceed until it receives no more bound...
Definition: OptionTags.hpp:432
Cce::Tags::EndTimeFromFile
Represents the final time of a bounded CCE evolution, determined either from option specification or ...
Definition: OptionTags.hpp:405
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::GhWorldtubeBoundary
Component that supplies CCE worldtube boundary data sourced from a running GH system.
Definition: WorldtubeBoundary.hpp:170
Cce::Actions::InitializeWorldtubeBoundary
Generic action for initializing various worldtube boundary components.
Definition: InitializeWorldtubeBoundary.hpp:85