1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
4 #pragma once
6 #include <string>
7 #include <tuple>
11 #include "ErrorHandling/Error.hpp"
12 #include "Evolution/Systems/Cce/Actions/ReceiveWorldtubeData.hpp"
13 #include "Evolution/Systems/Cce/ReadBoundaryDataH5.hpp"
14 #include "Evolution/Systems/Cce/ReceiveTags.hpp"
16 #include "Parallel/Invoke.hpp"
17 #include "Parallel/Printf.hpp"
18 #include "Time/Tags.hpp"
19 #include "Time/TimeStepId.hpp"
20 #include "Utilities/Gsl.hpp"
21 #include "Utilities/TMPL.hpp"
22 #include "Utilities/TypeTraits.hpp"
24 namespace Cce {
25 namespace Actions {
26 /*!
27  * \ingroup ActionsGroup
28  * \brief Obtains the CCE boundary data at the specified `time`, and reports it
29  * to the `EvolutionComponent` via `Actions::ReceiveWorldtubeData`.
30  *
31  * \details This uses the `WorldtubeDataManager` to perform all of the work of
32  * managing the file buffer, interpolating to the desired time point, and
33  * compute the Bondi quantities on the boundary. Once readied, it sends each
34  * tensor from the the full `Variables<typename
35  * Metavariables::cce_boundary_communication_tags>` back to the
36  * `EvolutionComponent`
37  *
38  * Uses:
39  * - DataBox:
40  * - `Tags::H5WorldtubeBoundaryDataManager`
41  *
42  * \ref DataBoxGroup changes:
43  * - Adds: nothing
44  * - Removes: nothing
45  * - Modifies:
46  * - `Tags::Variables<typename
47  * Metavariables::cce_boundary_communication_tags>` (every tensor)
48  */
49 template <typename EvolutionComponent>
51  template <typename ParallelComponent, typename... DbTags,
52  typename Metavariables, typename ArrayIndex,
55  typename Metavariables::cce_boundary_communication_tags>,
56  DbTags>...>> = nullptr>
57  static void apply(db::DataBox<tmpl::list<DbTags...>>& box,
59  const ArrayIndex& /*array_index*/,
60  const TimeStepId& time) noexcept {
61  if (not db::get<Tags::H5WorldtubeBoundaryDataManager>(box)
62  .populate_hypersurface_boundary_data(
63  make_not_null(&box), time.substep_time().value())) {
64  ERROR("Insufficient boundary data to proceed, exiting early at time " +
65  std::to_string(time.substep_time().value()));
66  }
68  typename Metavariables::cce_boundary_communication_tags>>(
69  Parallel::get_parallel_component<EvolutionComponent>(cache), time,
71  typename Metavariables::cce_boundary_communication_tags>>(box),
72  true);
73  }
74 };
75 } // namespace Actions
76 } // namespace Cce
Definition: Variables.hpp:46
#define ERROR(m)
prints an error message to the standard error stream and aborts the program.
Definition: Error.hpp:36
void receive_data(Proxy &&proxy, typename ReceiveTag::temporal_id temporal_id, ReceiveDataType &&receive_data, const bool enable_if_disabled) noexcept
Send the data args... to the algorithm running on proxy, and tag the message with the identifier temp...
Definition: Invoke.hpp:51
Contains functionality for Cauchy Characteristic Extraction.
Definition: BoundaryComputeAndSendToEvolution.hpp:24
constexpr bool flat_any_v
A non-short-circuiting logical OR between bools &#39;B"".
Definition: TMPL.hpp:529
Defines class TimeStepId.
double value() const noexcept
Approximate numerical value of the Time.
Definition: Time.hpp:44
A unique identifier for the temporal state of an integrated system.
Definition: TimeStepId.hpp:25
Defines classes and functions used for manipulating DataBox&#39;s.
constexpr bool is_same_v
Variable template for is_same.
Definition: TypeTraits.hpp:221
const Time & substep_time() const noexcept
Time of the current substep.
Definition: TimeStepId.hpp:61
A receive tag for the data sent to the CCE evolution component from the CCE boundary component...
Definition: ReceiveTags.hpp:16
Defines Parallel::printf for writing to stdout.
Definition: InterpolationTargetWedgeSectionTorus.hpp:24
Defines class Variables.
A Charm++ chare that caches constant data once per Charm++ node.
Definition: ConstGlobalCache.hpp:135
const auto & get(const DataBox< TagList > &box) noexcept
Retrieve the item with tag Tag from the DataBox.
Definition: DataBox.hpp:1211
Wraps the template metaprogramming library used (brigand)
Defines functions and classes from the GSL.
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, but it may be necessary to perform the conversion explicitly when type deduction is desired.
Definition: Gsl.hpp:879
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
Defines class template ConstGlobalCache.
Defines macro ERROR.
Defines type traits, some of which are future STL type_traits header.
Obtains the CCE boundary data at the specified time, and reports it to the EvolutionComponent via Act...
Definition: BoundaryComputeAndSendToEvolution.hpp:50
Defines tags related to Time quantities.
Definition: ComputeTimeDerivative.hpp:28