10 #include "DataStructures/VariablesTag.hpp"
11 #include "Evolution/Systems/Cce/Actions/ReceiveWorldtubeData.hpp"
12 #include "Evolution/Systems/Cce/Components/WorldtubeBoundary.hpp"
13 #include "Evolution/Systems/Cce/InterfaceManagers/GhInterfaceManager.hpp"
14 #include "Evolution/Systems/Cce/OptionTags.hpp"
15 #include "Evolution/Systems/Cce/ReceiveTags.hpp"
16 #include "Evolution/Systems/Cce/Tags.hpp"
17 #include "Evolution/Systems/Cce/WorldtubeDataManager.hpp"
19 #include "Parallel/Invoke.hpp"
21 #include "Time/Tags.hpp"
26 #include "Utilities/TypeTraits.hpp"
39 template <
typename BoundaryComponent,
typename EvolutionComponent>
59 template <
typename BoundaryComponent,
typename EvolutionComponent>
85 template <
typename Metavariables,
typename EvolutionComponent>
88 template <
typename ParallelComponent,
typename... DbTags,
typename ArrayIndex,
91 typename Metavariables::cce_boundary_communication_tags>,
92 DbTags>...>> =
nullptr>
93 static void apply(db::DataBox<tmpl::list<DbTags...>>& box,
97 bool successfully_populated =
false;
100 typename Metavariables::cce_boundary_communication_tags>>(
102 [&successfully_populated, &time](
104 worldtube_data_manager,
106 typename Metavariables::cce_boundary_communication_tags>*>
107 boundary_variables) noexcept {
108 successfully_populated =
109 (*worldtube_data_manager)
110 ->populate_hypersurface_boundary_data(
111 boundary_variables, time.substep_time().value());
113 if (not successfully_populated) {
114 ERROR(
"Insufficient boundary data to proceed, exiting early at time " +
115 std::to_string(time.substep_time().value()));
118 typename Metavariables::cce_boundary_communication_tags>>(
119 Parallel::get_parallel_component<EvolutionComponent>(cache), time,
121 typename Metavariables::cce_boundary_communication_tags>>(box),
142 template <
typename Metavariables,
typename EvolutionComponent>
145 template <
typename ParallelComponent,
typename DbTagList,
typename ArrayIndex>
146 static void apply(db::DataBox<DbTagList>& box,
150 if constexpr (tmpl::list_contains_v<
153 cce_boundary_communication_tags>>) {
154 bool successfully_populated =
false;
157 typename Metavariables::cce_boundary_communication_tags>>(
159 [&successfully_populated, &time](
161 worldtube_data_manager,
163 typename Metavariables::cce_boundary_communication_tags>*>
164 boundary_variables) noexcept {
165 successfully_populated =
166 (*worldtube_data_manager)
167 .populate_hypersurface_boundary_data(
168 boundary_variables, time.substep_time().value());
171 if (not successfully_populated) {
172 ERROR(
"Insufficient boundary data to proceed, exiting early at time "
173 << time.substep_time().value());
176 typename Metavariables::cce_boundary_communication_tags>>(
177 Parallel::get_parallel_component<EvolutionComponent>(cache), time,
179 typename Metavariables::cce_boundary_communication_tags>>(box),
183 "Did not find required tag `::Tags::Variables<typename "
184 "Metavariables::cce_boundary_communication_tags>` in the DataBox");
211 template <
typename Metavariables,
typename EvolutionComponent>
213 EvolutionComponent> {
214 template <
typename ParallelComponent,
typename... DbTags,
typename ArrayIndex,
217 typename Metavariables::cce_boundary_communication_tags>,
218 DbTags>...>> =
nullptr>
219 static void apply(db::DataBox<tmpl::list<DbTags...>>& box,
223 db::mutate<Tags::GhInterfaceManager>(
227 interface_manager) noexcept {
228 (*interface_manager)->request_gh_data(time);
230 (*interface_manager)->retrieve_and_remove_first_ready_gh_data();
231 if (
static_cast<bool>(gh_data)) {
236 get<0>(*gh_data), get<1>(*gh_data));
243 template <
typename Metavariables,
typename EvolutionComponent>
245 template <
typename ParallelComponent,
typename... DbTags,
typename ArrayIndex,
248 typename Metavariables::cce_boundary_communication_tags>,
249 DbTags>...>> =
nullptr>
250 static void apply(db::DataBox<tmpl::list<DbTags...>>& box,
253 const InterfaceManagers::GhInterfaceManager::gh_variables&
254 gh_variables) noexcept {
256 typename Metavariables::cce_boundary_communication_tags>>(
260 typename Metavariables::cce_boundary_communication_tags>*>
262 const double extraction_radius,
const double l_max) noexcept {
271 extraction_radius, l_max);
273 db::get<InitializationTags::ExtractionRadius>(box),
274 db::get<Tags::LMax>(box));
276 typename Metavariables::cce_boundary_communication_tags>>(
277 Parallel::get_parallel_component<EvolutionComponent>(cache), time,
279 typename Metavariables::cce_boundary_communication_tags>>(box),
constexpr Tag::type & get(Variables< TagList > &v) noexcept
Return Tag::type pointing into the contiguous array.
Definition: Variables.hpp:638
Definition: ElementReceiveInterpPoints.hpp:15
auto get_parallel_component(GlobalCache< Metavariables > &cache) noexcept -> Parallel::proxy_from_parallel_component< GlobalCache_detail::get_component_if_mocked< typename Metavariables::component_list, ParallelComponentTag >> &
Access the Charm++ proxy associated with a ParallelComponent.
Definition: GlobalCache.hpp:521
constexpr bool flat_any_v
A non-short-circuiting logical OR between bools 'B"".
Definition: TMPL.hpp:530
const auto & get(const DataBox< TagList > &box) noexcept
Retrieve the item with tag Tag from the DataBox.
Definition: DataBox.hpp:969
void mutate(const gsl::not_null< DataBox< TagList > * > box, Invokable &&invokable, Args &&... args) noexcept
Allows changing the state of one or more non-computed elements in the DataBox.
Definition: DataBox.hpp:859
Component that supplies CCE worldtube boundary data sourced from an analytic solution.
Definition: WorldtubeBoundary.hpp:127
#define ERROR(m)
prints an error message to the standard error stream and aborts the program.
Definition: Error.hpp:36
Component that supplies CCE worldtube boundary data.
Definition: WorldtubeBoundary.hpp:86
Definition: TimeStepId.hpp:25
The set of utilities for performing Cauchy characteristic evolution and Cauchy characteristic matchin...
Definition: BoundaryComputeAndSendToEvolution.hpp:28
void receive_data(Proxy &&proxy, typename ReceiveTag::temporal_id temporal_id, ReceiveDataType &&receive_data, const bool enable_if_disabled=false) noexcept
Send the data args... to the algorithm running on proxy, and tag the message with the identifier temp...
Definition: Invoke.hpp:49
void create_bondi_boundary_data(const gsl::not_null< Variables< BoundaryTagList > * > bondi_boundary_data, const tnsr::iaa< DataVector, 3 > &phi, const tnsr::aa< DataVector, 3 > &pi, const tnsr::aa< DataVector, 3 > &spacetime_metric, const double extraction_radius, const size_t l_max) noexcept
Process the worldtube data from generalized harmonic quantities to desired Bondi quantities,...
Definition: BoundaryData.hpp:792
Computes Bondi boundary data from GH evolution variables and sends the result to the EvolutionCompone...
Definition: BoundaryComputeAndSendToEvolution.hpp:60
Component that supplies CCE worldtube boundary data sourced from a running GH system.
Definition: WorldtubeBoundary.hpp:170
void simple_action(Proxy &&proxy) noexcept
Invoke a simple action on proxy
Definition: Invoke.hpp:84
gsl::not_null< T * > make_not_null(T *ptr) noexcept
Construct a not_null from a pointer. Often this will be done as an implicit conversion,...
Definition: Gsl.hpp:880
typename Requires_detail::requires_impl< B >::template_error_type_failed_to_meet_requirements_on_template_parameters Requires
Express requirements on the template parameters of a function or class, replaces std::enable_if_t
Definition: Requires.hpp:67
Obtains the CCE boundary data at the specified time, and reports it to the EvolutionComponent via Act...
Definition: BoundaryComputeAndSendToEvolution.hpp:40
Require a pointer to not be a nullptr
Definition: ReadSpecThirdOrderPiecewisePolynomial.hpp:13