ElementReceiveInterpPoints.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
8 #include "DataStructures/IdPair.hpp"
9 #include "Domain/BlockLogicalCoordinates.hpp"
10 #include "NumericalAlgorithms/Interpolation/PointInfoTag.hpp"
11 #include "Utilities/Gsl.hpp"
12 #include "Utilities/Requires.hpp"
13 
14 namespace Parallel {
15 template <typename Metavariables>
17 } // namespace Parallel
18 
19 namespace intrp {
20 namespace Actions {
21 
22 /// \ingroup ActionsGroup
23 /// \brief Receives interpolation points from an InterpolationTarget.
24 ///
25 /// Uses: nothing
26 ///
27 /// DataBox changes:
28 /// - Adds: nothing
29 /// - Removes: nothing
30 /// - Modifies:
31 /// - `intrp::Tags::InterpPointInfo<Metavariables>`
32 template <typename InterpolationTargetTag>
34  template <typename ParallelComponent, typename DbTags, typename Metavariables,
35  typename ArrayIndex,
36  Requires<tmpl::list_contains_v<
38  static void apply(
41  const ArrayIndex& /*array_index*/,
42  std::vector<boost::optional<
43  IdPair<domain::BlockId, tnsr::I<double, Metavariables::volume_dim,
44  typename ::Frame::Logical>>>>&&
45  block_logical_coords) noexcept {
46  db::mutate<intrp::Tags::InterpPointInfo<Metavariables>>(
47  make_not_null(&box),
48  [&block_logical_coords](
49  const gsl::not_null<
51  point_infos) noexcept {
52  get<intrp::Vars::PointInfoTag<InterpolationTargetTag,
53  Metavariables::volume_dim>>(
54  *point_infos) = std::move(block_logical_coords);
55  });
56  }
57 };
58 } // namespace Actions
59 } // namespace intrp
Parallel::ConstGlobalCache
Definition: ElementReceiveInterpPoints.hpp:16
intrp::Tags::InterpPointInfo
The following tag is for the case in which interpolation bypasses the Interpolator ParallelComponent....
Definition: PointInfoTag.hpp:44
DataBoxTag.hpp
get
constexpr Tag::type & get(Variables< TagList > &v) noexcept
Return Tag::type pointing into the contiguous array.
Definition: Variables.hpp:689
std::vector
intrp::Vars::PointInfoTag
Definition: PointInfoTag.hpp:18
IdPair
A data structure that contains an ID and data associated with that ID.
Definition: IdPair.hpp:16
DataBox.hpp
intrp::Actions::ElementReceiveInterpPoints
Receives interpolation points from an InterpolationTarget.
Definition: ElementReceiveInterpPoints.hpp:33
db::item_type
typename DataBox_detail::item_type_impl< TagList, Tag >::type item_type
Get the type that can be written to the Tag. If it is a base tag then a TagList must be passed as a s...
Definition: DataBoxTag.hpp:246
Gsl.hpp
Requires.hpp
domain::BlockId
Index a block of the computational domain.
Definition: BlockId.hpp:21
make_not_null
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
Requires
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
db::DataBox
Definition: InterpolationTargetWedgeSectionTorus.hpp:24
Parallel
Contains functions that forward to Charm++ parallel functions.
Definition: ElementReceiveInterpPoints.hpp:14
gsl::not_null
Require a pointer to not be a nullptr
Definition: Gsl.hpp:183