10 #include "DataStructures/IdPair.hpp"
12 #include "Domain/Structure/BlockId.hpp"
13 #include "Evolution/Systems/Cce/Actions/BoundaryComputeAndSendToEvolution.hpp"
14 #include "Evolution/Systems/Cce/Components/CharacteristicEvolution.hpp"
15 #include "Evolution/Systems/Cce/OptionTags.hpp"
16 #include "Evolution/Systems/Cce/Tags.hpp"
17 #include "NumericalAlgorithms/Interpolation/PointInfoTag.hpp"
19 #include "Parallel/Invoke.hpp"
21 #include "Time/Tags.hpp"
28 struct ReceiveNextElementTime;
53 template <
typename InterpolationTargetTag>
55 using const_global_cache_tags = tmpl::list<::Tags::TimeStepper<TimeStepper>>;
56 template <
typename DbTags,
typename Metavariables,
typename... InboxTags,
57 typename ArrayIndex,
typename ActionList,
58 typename ParallelComponent>
60 db::DataBox<DbTags>& box,
63 const ArrayIndex& array_index,
const ActionList ,
64 const ParallelComponent*
const ) noexcept {
65 const auto& block_logical_coords =
67 Metavariables::volume_dim>>(
68 db::get<intrp::Tags::InterpPointInfo<Metavariables>>(box));
73 first_valid_block_logical_coords;
74 for (
const auto& coordinate : block_logical_coords) {
75 if (coordinate.has_value()) {
76 first_valid_block_logical_coords.push_back(coordinate);
80 if (first_valid_block_logical_coords.empty() ) {
82 "Warning: No valid block logical coordinates found, please ensure "
83 "that at least one point for the interpolation is within the domain "
84 "to use `SendNextTimeToCce`. No 'next' time is sent, but execution "
88 element_ids, first_valid_block_logical_coords);
90 if (
UNLIKELY(db::get<::Tags::TimeStepId>(box).substep() == 0 and
91 element_coord_holders.count(element_ids[0]) != 0)) {
93 auto next_step_id = db::get<::Tags::Next<::Tags::TimeStepId>>(box);
94 while (next_step_id.substep() != 0) {
96 db::get<::Tags::TimeStepper<TimeStepper>>(box).next_time_id(
97 next_step_id, db::get<::Tags::TimeStep>(box));
100 typename Metavariables::cce_boundary_component>(
cache);
101 Parallel::simple_action<Actions::ReceiveNextElementTime>(
102 receiver_proxy, db::get<::Tags::TimeStepId>(box),
103 std::move(next_step_id));
105 return std::forward_as_tuple(std::move(box));
126 template <
typename ParallelComponent,
typename... DbTags,
typename ArrayIndex,
127 typename Metavariables>
128 static void apply(db::DataBox<tmpl::list<DbTags...>>& box,
132 if constexpr (tmpl::list_contains_v<tmpl::list<DbTags...>,
134 db::mutate<Tags::GhInterfaceManager>(
139 interface_manager) noexcept {
140 (*interface_manager)->insert_next_gh_time(time, next_time);
144 (*interface_manager)->retrieve_and_remove_first_ready_gh_data();
145 if (
static_cast<bool>(gh_data)) {
151 get<0>(*gh_data), get<1>(*gh_data));
156 "Tags::GhInterfaceManager must be present in the DataBox to execute "
157 "simple action `ReceiveNextElementTime`.");
#define UNLIKELY(x)
Definition: Gsl.hpp:73
constexpr Tag::type & get(Variables< TagList > &v) noexcept
Return Tag::type pointing into the contiguous array.
Definition: Variables.hpp:660
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:507
void printf(const std::string &format, Args &&... args)
Print an atomic message to stdout with C printf usage.
Definition: Printf.hpp:103
Definition: PointInfoTag.hpp:18
A data structure that contains an ID and data associated with that ID.
Definition: IdPair.hpp:16
#define ERROR(m)
prints an error message to the standard error stream and aborts the program.
Definition: Error.hpp:36
An associative container that is indexed by structs.
Definition: TaggedTuple.hpp:271
The set of actions for use in the CCE evolution system.
Definition: BoundaryComputeAndSendToEvolution.hpp:29
Definition: TimeStepId.hpp:25
auto element_logical_coordinates(const std::vector< ElementId< Dim >> &element_ids, const std::vector< std::optional< IdPair< domain::BlockId, tnsr::I< double, Dim, typename Frame::Logical >>>> &block_coord_holders) noexcept -> std::unordered_map< ElementId< Dim >, ElementLogicalCoordHolder< Dim >>
Parallel::GlobalCache< Metavariables > & cache(MockRuntimeSystem< Metavariables > &runner, const ArrayIndex &array_index) noexcept
Returns the GlobalCache of Component with index array_index.
Definition: MockRuntimeSystemFreeFunctions.hpp:362
Stash the next_time in the Cce::InterfaceManagers::GhInterfaceManager to inform the local time-steppi...
Definition: SendNextTimeToCce.hpp:125
The component for handling the CCE evolution and waveform output.
Definition: CharacteristicEvolution.hpp:92
Index a block of the computational domain.
Definition: BlockId.hpp:21
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:166
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
If the element contains the first point in the interpolation collection, sends the next (full) TimeSt...
Definition: SendNextTimeToCce.hpp:54
Require a pointer to not be a nullptr
Definition: ReadSpecThirdOrderPiecewisePolynomial.hpp:13