SpECTRE  v2024.04.12
intrp::protocols::PostInterpolationCallback Struct Reference

A protocol for the type alias post_interpolation_callbacks found in an InterpolationTargetTag. More...

#include <PostInterpolationCallback.hpp>

Classes

struct  test
 

Detailed Description

A protocol for the type alias post_interpolation_callbacks found in an InterpolationTargetTag.

Details

A struct conforming to the PostInterpolationCallback protocol must have

  • a function apply with one of the 3 signatures in the example. This apply function will be called once the interpolation is complete. DbTags includes everything in the vars_to_interpolate_to_target alias and the compute_items_on_target alias of the InterpolationTargetTag. The apply that returns a bool should return false only if it calls another intrp::Action that still needs the volume data at this temporal_id (such as another iteration of the horizon finder). These functions must be able to take any type for the TemporalId. If a specific temporal ID type is required, it should be static_asserted in the function itself.

A struct conforming to this protocol can also have an optional static constexpr double fill_invalid_points_with. Any points outside the Domain will be filled with this value. If this variable is not defined, then the apply function must check for invalid points, and should typically exit with an error message if it finds any.

Here is an example of a class that conforms to this protocols:

struct ExamplePostInterpolationCallback
: tt::ConformsTo<intrp::protocols::PostInterpolationCallback> {
// This is not required by the protocol, but can be specified.
static constexpr double fill_invalid_points_with = 0.0;
// Signature 1. This bool is false if another interpolation action is called
template <typename DbTags, typename Metavariables, typename TemporalId>
static bool apply(
const gsl::not_null<db::DataBox<DbTags>*> /*box*/,
const TemporalId& temporal_id) {
return intrp::InterpolationTarget_detail::get_temporal_id_value(
temporal_id) > 1.0;
}
// Signature 2. This is just as an example
template <typename DbTags, typename Metavariables, typename TemporalId>
static void apply(const db::DataBox<DbTags>& /*box*/,
const TemporalId& /*temporal_id*/) {}
// Signature 3. This is just as an example
template <typename DbTags, typename Metavariables, typename TemporalId>
static void apply(const db::DataBox<DbTags>& /*box*/,
const TemporalId& /*temporal_id*/) {}
};
A Charm++ chare that caches global data once per Charm++ node.
Definition: GlobalCache.hpp:221
Require a pointer to not be a nullptr
Definition: Gsl.hpp:183
auto apply(F &&f, const ObservationBox< ComputeTagsList, DataBoxType > &observation_box, Args &&... args)
Apply the function object f using its nested argument_tags list of tags.
Definition: ObservationBox.hpp:238
Indicate a class conforms to the Protocol.
Definition: ProtocolHelpers.hpp:22

The documentation for this struct was generated from the following file: