RequestBoundaryData.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
6 #include <tuple>
7 #include <utility>
8 
11 #include "Parallel/Invoke.hpp"
12 #include "Time/Tags.hpp"
13 
14 namespace Cce {
15 namespace Actions {
16 /// \cond
17 template <typename EvolutionComoponent>
18 struct BoundaryComputeAndSendToEvolution;
19 /// \endcond
20 
21 /*!
22  * \ingroup ActionsGroup
23  * \brief Requests boundary data be sent from `WorldtubeBoundaryComponent` to
24  * `EvolutionComponent` (template parameters).
25  *
26  * \details Calls the simple action
27  * `Cce::Actions::BoundaryComputeAndSendToEvolution<EvolutionComponent>` on the
28  * `WorldtubeBoundaryComponent`, which performs boundary computations then sends
29  * data to the `EvolutionComponent` via `Cce::Actions::ReceiveWorldtubeData`.
30  * Requests data at the current `Tags::TimeStepId`.
31  * For the majority of these requests, it's better to issue them as early as
32  * possible to maximize the degree of parallelism for the system, so most calls
33  * should use `Cce::Actions::RequestNextBoundaryData`, because it can be called
34  * the substep prior to when the data will actually be used.
35  *
36  * Uses:
37  * - DataBox:
38  * - `Tags::TimeStepId`
39  *
40  * \ref DataBoxGroup changes
41  * - Adds: nothing
42  * - Removes: nothing
43  * - Modifies: nothing
44  */
45 template <typename WorldtubeBoundaryComponent, typename EvolutionComponent>
47  template <typename DbTags, typename... InboxTags, typename Metavariables,
48  typename ArrayIndex, typename ActionList,
49  typename ParallelComponent>
50  static auto apply(db::DataBox<DbTags>& box,
51  const tuples::TaggedTuple<InboxTags...>& /*inboxes*/,
53  const ArrayIndex& /*array_index*/,
54  const ActionList /*meta*/,
55  const ParallelComponent* const /*meta*/) noexcept {
58  Parallel::get_parallel_component<WorldtubeBoundaryComponent>(cache),
59  db::get<::Tags::TimeStepId>(box));
60  return std::forward_as_tuple(std::move(box));
61  }
62 };
63 
64 /*!
65  * \ingroup ActionsGroup
66  * \brief Requests boundary data be sent from `WorldtubeBoundaryComponent` to
67  * `EvolutionComponent`.
68  *
69  * \details Calls the simple action
70  * `Cce::Actions::BoundaryComputeAndSendToEvolution<EvolutionComponent>` on the
71  * `WorldtubeBoundaryComponent`, which performs boundary computations then sends
72  * data to the `EvolutionComponent` via `Cce::Actions::ReceiveWorldtubeData`.
73  * Requests data at the `Tags::Next<Tags::TimeStepId>` (for the next timestep).
74  *
75  * Uses:
76  * - DataBox:
77  * - `Tags::Next<Tags::TimeStepId>`
78  *
79  * \ref DataBoxGroup changes
80  * - Adds: nothing
81  * - Removes: nothing
82  * - Modifies: nothing
83  */
84 template <typename WorldtubeBoundaryComponent, typename EvolutionComponent>
86  template <typename DbTags, typename... InboxTags, typename Metavariables,
87  typename ArrayIndex, typename ActionList,
88  typename ParallelComponent>
89  static auto apply(db::DataBox<DbTags>& box,
90  const tuples::TaggedTuple<InboxTags...>& /*inboxes*/,
92  const ArrayIndex& /*array_index*/,
93  const ActionList /*meta*/,
94  const ParallelComponent* const /*meta*/) noexcept {
97  Parallel::get_parallel_component<WorldtubeBoundaryComponent>(cache),
99  return std::forward_as_tuple(std::move(box));
100  }
101 };
102 } // namespace Actions
103 } // namespace Cce
Requests boundary data be sent from WorldtubeBoundaryComponent to EvolutionComponent.
Definition: RequestBoundaryData.hpp:85
Contains functionality for Cauchy Characteristic Extraction.
Definition: BoundaryComputeAndSendToEvolution.hpp:24
An associative container that is indexed by structs.
Definition: TaggedTuple.hpp:273
Defines classes and functions used for manipulating DataBox&#39;s.
Definition: InterpolationTargetWedgeSectionTorus.hpp:24
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
Requests boundary data be sent from WorldtubeBoundaryComponent to EvolutionComponent (template parame...
Definition: RequestBoundaryData.hpp:46
Prefix indicating the value a quantity will take on the next iteration of the algorithm.
Definition: Prefixes.hpp:150
void simple_action(Proxy &&proxy) noexcept
Invoke a simple action on proxy
Definition: Invoke.hpp:112
Defines class template ConstGlobalCache.
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