ElementReceiveInterpPoints.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
7 #include "DataStructures/IdPair.hpp"
8 #include "Domain/BlockLogicalCoordinates.hpp"
9 #include "NumericalAlgorithms/Interpolation/PointInfoTag.hpp"
10 #include "Utilities/Gsl.hpp"
11 #include "Utilities/Requires.hpp"
12 
13 namespace Parallel {
14 template <typename Metavariables>
16 } // namespace Parallel
17 
18 namespace intrp {
19 namespace Actions {
20 
21 /// \ingroup ActionsGroup
22 /// \brief Receives interpolation points from an InterpolationTarget.
23 ///
24 /// Uses: nothing
25 ///
26 /// DataBox changes:
27 /// - Adds: nothing
28 /// - Removes: nothing
29 /// - Modifies:
30 /// - `intrp::Tags::InterpPointInfo<Metavariables>`
31 template <typename InterpolationTargetTag>
33  template <typename ParallelComponent, typename DbTags, typename Metavariables,
34  typename ArrayIndex,
35  Requires<tmpl::list_contains_v<
37  static void apply(
38  db::DataBox<DbTags>& box,
40  const ArrayIndex& /*array_index*/,
42  IdPair<domain::BlockId, tnsr::I<double, Metavariables::volume_dim,
43  typename ::Frame::Logical>>>>&&
44  block_logical_coords) noexcept {
45  db::mutate<intrp::Tags::InterpPointInfo<Metavariables>>(
46  make_not_null(&box),
47  [&block_logical_coords](
48  const gsl::not_null<
49  typename intrp::Tags::InterpPointInfo<Metavariables>::type*>
50  point_infos) noexcept {
51  get<intrp::Vars::PointInfoTag<InterpolationTargetTag,
52  Metavariables::volume_dim>>(
53  *point_infos) = std::move(block_logical_coords);
54  });
55  }
56 };
57 } // namespace Actions
58 } // namespace intrp
intrp::Tags::InterpPointInfo
The following tag is for the case in which interpolation bypasses the Interpolator ParallelComponent....
Definition: PointInfoTag.hpp:44
get
constexpr Tag::type & get(Variables< TagList > &v) noexcept
Return Tag::type pointing into the contiguous array.
Definition: Variables.hpp:660
Parallel::GlobalCache
Definition: ElementReceiveInterpPoints.hpp:15
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:32
Gsl.hpp
Requires.hpp
domain::BlockId
Index a block of the computational domain.
Definition: BlockId.hpp:21
std::optional
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
Parallel
Functionality for parallelization.
Definition: ElementReceiveInterpPoints.hpp:13
gsl::not_null
Require a pointer to not be a nullptr
Definition: ReadSpecThirdOrderPiecewisePolynomial.hpp:13