A protocol for the type alias compute_target_points found in an InterpolationTargetTag.
Details
A struct conforming to the ComputeTargetPoints protocol must have
- a type alias is_sequential that is either std::true_type or std::false_type which indicates if interpolations depend on previous interpolations' results. It is assumed in the interpolation framework that only horizon finds are sequential (e.y. anything that uses the intrp::Interpolator component is a sequential horizon find).
- a type alias frame that denotes the frame the target points are computed in
- a function points with signature matching the one in the example that will compute the points in the given frame (with or without the const & on the box argument).
A struct that conforms to this protocol can optionally have any of these members as well:
- a type alias simple_tags that list simple tags to be added to the DataBox of the InterpolationTarget
- a type alias compute_tags that list compute tags to be added to the DataBox of the InterpolationTarget
- a type alias const_global_cache_tags with tags to be put in the GlobalCache
- a function initialize with signature matching the one in the example that is run during the Initialization phase of the InterpolationTarget and can initialize any of the simple_tags added.
Here is an example of a class that conforms to this protocols:
: tt::ConformsTo<intrp::protocols::ComputeTargetPoints> {
using const_global_cache_tags = tmpl::list<FakeCacheTag>;
using is_sequential = std::false_type;
using frame = ::Frame::Grid;
using simple_tags = tmpl::list<FakeSimpleTag>;
using compute_tags = tmpl::list<FakeComputeTag>;
template <typename DbTags, typename Metavariables>
static void initialize(
const gsl::not_null<db::DataBox<DbTags>*> ,
const Parallel::GlobalCache<Metavariables>& ) {
}
template <typename Metavariables, typename DbTags, typename TemporalId>
static tnsr::I<DataVector, 3, frame> points(
const db::DataBox<DbTags>& ,
const tmpl::type_<Metavariables>& ,
const TemporalId& ) {
return tnsr::I<DataVector, 3, frame>{};
}
};