InterpolatorRegisterElement.hpp
1 // Distributed under the MIT License.
2 // See LICENSE.txt for details.
3 
4 #pragma once
5 
8 #include "NumericalAlgorithms/Interpolation/Tags.hpp"
10 #include "Utilities/Gsl.hpp"
12 
13 namespace intrp {
14 namespace Actions {
15 
16 /// \ingroup ActionsGroup
17 /// \brief Called by each local Element to register itself with an Interpolator.
18 ///
19 /// Uses: nothing
20 ///
21 /// DataBox changes:
22 /// - Adds: nothing
23 /// - Removes: nothing
24 /// - Modifies:
25 /// - `Tags::NumberOfElements`
26 ///
27 /// For requirements on Metavariables, see InterpolationTarget.
29  template <
30  typename DbTags, typename... InboxTags, typename Metavariables,
31  typename ArrayIndex, typename ActionList, typename ParallelComponent,
33  nullptr>
34  static void apply(db::DataBox<DbTags>& box,
35  const tuples::TaggedTuple<InboxTags...>& /*inboxes*/,
37  const ArrayIndex& /*array_index*/,
38  const ActionList /*meta*/,
39  const ParallelComponent* const /*meta*/) noexcept {
40  db::mutate<Tags::NumberOfElements>(
41  make_not_null(&box), [](const gsl::not_null<
43  num_elements) noexcept {
44  ++(*num_elements);
45  });
46  }
47 };
48 
49 } // namespace Actions
50 } // namespace intrp
Defines class tuples::TaggedTuple.
Definition: AddTemporalIdsToInterpolationTarget.hpp:17
An associative container that is indexed by structs.
Definition: TaggedTuple.hpp:272
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:76
typename DataBox_detail::item_type_impl< TagList, Tag >::type item_type
Get the type that is returned by the Tag. If it is a base tag then a TagList must be passed as a seco...
Definition: DataBoxTag.hpp:410
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:863
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
Definition: SolvePoissonProblem.hpp:38
Defines classes SimpleTag, PrefixTag, ComputeTag and several functions for retrieving tag info...
Defines class template ConstGlobalCache.
Called by each local Element to register itself with an Interpolator.
Definition: InterpolatorRegisterElement.hpp:28
Definition: ComputeTimeDerivative.hpp:28
Require a pointer to not be a nullptr
Definition: ConservativeFromPrimitive.hpp:12