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 options = tmpl::list<>;
43 
44  static void initialize(Parallel::CProxy_GlobalCache<
45  Metavariables>& /*global_cache*/) noexcept {}
46 
47  static void execute_next_phase(
48  const typename Metavariables::Phase next_phase,
49  const Parallel::CProxy_GlobalCache<Metavariables>&
50  global_cache) noexcept {
51  auto& local_cache = *(global_cache.ckLocalBranch());
52  if (next_phase == Metavariables::Phase::Evolve) {
53  Parallel::get_parallel_component<WorldtubeComponent>(local_cache)
54  .start_phase(next_phase);
55  }
56  }
57 };
58 
59 /*!
60  * \brief Component that supplies CCE worldtube boundary data.
61  *
62  * \details The \ref DataBoxGroup associated with the worldtube boundary
63  * component contains a data manager (e.g. `WorldtubeDataManager`) linked to
64  * an H5 file. The data manager handles buffering and interpolating to desired
65  * target time points when requested via the simple action
66  * `BoundaryComputeAndSendToEvolution`, at which point it will send the required
67  * collection of boundary quantities to the identified 'CharacteristicEvolution'
68  * component. It is assumed that the simple action
69  * `BoundaryComputeAndSendToEvolution` will only be called during the
70  * `Evolve` phase.
71  *
72  * Uses const global tags:
73  * - `Tags::LMax`
74  *
75  * `Metavariables` must contain:
76  * - the `enum` `Phase` with at least `Initialization` and `Evolve` phases.
77  * - a type alias `cce_boundary_communication_tags` for the set of tags to send
78  * from the worldtube to the evolution component. This will typically be
79  * `Cce::Tags::characteristic_worldtube_boundary_tags<Tags::BoundaryValue>`.
80  */
81 template <class Metavariables>
83  : public WorldtubeComponentBase<H5WorldtubeBoundary<Metavariables>,
84  Metavariables> {
85  using base_type =
87  using base_type::execute_next_phase;
88  using base_type::initialize;
89  using typename base_type::chare_type;
90  using const_global_cache_tags = tmpl::list<Tags::InitializeJ>;
91  using typename base_type::initialization_tags;
92  using typename base_type::metavariables;
93  using typename base_type::options;
94  using typename base_type::phase_dependent_action_list;
95  using end_time_tag = Tags::EndTimeFromFile;
96 };
97 
98 /*!
99  * \brief Component that supplies CCE worldtube boundary data sourced from an
100  * analytic solution.
101  *
102  * \details The \ref DataBoxGroup associated with the worldtube boundary
103  * component contains a data manager (e.g. `AnalyticBoundaryDataManager`) that
104  * contains the analytic solution being provided. The data manager handles
105  * computation of the analytic solution boundary data when requested via
106  * the simple action `BoundaryComputeAndSendToEvolution`, at which point it will
107  * send the required collection of boundary quantities to the identified
108  * 'CharacteristicEvolution' component. It is assumed that the simple action
109  * `BoundaryComputeAndSendToEvolution` will only be called during the
110  * `Evolve` phase.
111  *
112  * Uses const global tags:
113  * - `Tags::LMax`
114  * - `Tags::SpecifiedEndTime`
115  *
116  * `Metavariables` must contain:
117  * - the `enum` `Phase` with at least `Initialization` and `Evolve` phases.
118  * - a type alias `cce_boundary_communication_tags` for the set of tags to send
119  * from the worldtube to the evolution component. This will typically be
120  * `Cce::Tags::characteristic_worldtube_boundary_tags<Tags::BoundaryValue>`.
121  */
122 template <class Metavariables>
123 struct AnalyticWorldtubeBoundary
124  : public WorldtubeComponentBase<AnalyticWorldtubeBoundary<Metavariables>,
125  Metavariables> {
126  using base_type =
127  WorldtubeComponentBase<AnalyticWorldtubeBoundary<Metavariables>,
128  Metavariables>;
129  using base_type::execute_next_phase;
130  using base_type::initialize;
131  using typename base_type::chare_type;
132  using const_global_cache_tags = tmpl::list<Tags::AnalyticInitializeJ>;
133  using typename base_type::initialization_tags;
134  using typename base_type::metavariables;
135  using typename base_type::options;
136  using typename base_type::phase_dependent_action_list;
137  using end_time_tag = Tags::SpecifiedEndTime;
138 };
139 
140 /*!
141  * \brief Component that supplies CCE worldtube boundary data sourced from a
142  * running GH system.
143  *
144  * \details The \ref DataBoxGroup associated with the worldtube boundary
145  * component contains an interface manager (derived from
146  * `Cce::GhWorldtubeInterfaceManager`) that stores and provides the data
147  * received from the GH system. The data manager handles buffering
148  * and interpolating to desired target time points when requested via the simple
149  * action `Cce::Actions::BoundaryComputeAndSendToEvolution`, at which point it
150  * will send the required collection of boundary quantities to the identified
151  * `CharacteristicEvolution` component. It is assumed that the simple action
152  * `Cce::Actions::BoundaryComputeAndSendToEvolution` will only be called during
153  * the `Evolve` phase.
154  *
155  * Uses const global tags:
156  * - `InitializationTags::LMax`
157  * - `InitializationTags::ExtractionRadius`
158  *
159  * `Metavariables` must contain:
160  * - the `enum` `Phase` with at least `Initialization` and `Evolve` phases.
161  * - a type alias `cce_boundary_communication_tags` for the set of tags to send
162  * from the worldtube to the evolution component. This will typically be
163  * `Cce::Tags::characteristic_worldtube_boundary_tags<Tags::BoundaryValue>`.
164  */
165 template <class Metavariables>
167  : public WorldtubeComponentBase<GhWorldtubeBoundary<Metavariables>,
168  Metavariables> {
169  using base_type =
171  using base_type::execute_next_phase;
172  using base_type::initialize;
173  using typename base_type::chare_type;
174  using const_global_cache_tags = tmpl::list<Tags::InitializeJ>;
175  using typename base_type::initialization_tags;
176  using typename base_type::metavariables;
177  using typename base_type::options;
178  using typename base_type::phase_dependent_action_list;
180 };
181 } // 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:102
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:254
Cce::H5WorldtubeBoundary
Component that supplies CCE worldtube boundary data.
Definition: CharacteristicExtractFwd.hpp:8
Parallel::PhaseActions
List of all the actions to be executed in the specified phase.
Definition: PhaseDependentActionList.hpp:16
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: CharacteristicExtractFwd.hpp:6
Cce::GhWorldtubeBoundary
Component that supplies CCE worldtube boundary data sourced from a running GH system.
Definition: WorldtubeBoundary.hpp:166
Cce::Actions::InitializeWorldtubeBoundary
Generic action for initializing various worldtube boundary components.
Definition: InitializeWorldtubeBoundary.hpp:84