SpECTRE  v2026.04.01
Loading...
Searching...
No Matches
intrp::protocols::ComputeVarsToInterpolate Struct Reference

A protocol for the type alias compute_vars_to_interpolate that can potentially be found in an InterpolationTargetTag (potentially because an InterpolationTargetTag does not require this type alias). More...

#include <ComputeVarsToInterpolate.hpp>

Classes

struct  test

Detailed Description

A protocol for the type alias compute_vars_to_interpolate that can potentially be found in an InterpolationTargetTag (potentially because an InterpolationTargetTag does not require this type alias).

Details

A struct conforming to the ComputeVarsToInterpolate protocol must have

  • a type alias allowed_src_tags which is a tmpl::list of tags from the volume that can be used to compute quantities that will be interpolated onto the target.
  • a type alias required_src_tags which is a tmpl::list of tags from the volume that are necessary to compute quantities that will be interpolated onto the target. This list must be a subset of allowed_src_tags.
  • a type alias allowed_dest_tags<Frame> which is a tmpl::list of tags on the target that can be computed from the source tags.
  • a type alias required_dest_tags<Frame> which is a tmpl::list of tags on the target that must be computed from the source tags. This list must be a subset of allowed_dest_tags<Frame>
  • an apply function with at least one of the signatures in the example. This apply function fills the vars_to_interpolate_to_target type alias from the InterpolationTargetTag. Here Dim is Metavariables::volume_dim, SrcFrame is typically Frame::Inertial and TargetFrame is the frame of vars_to_interpolate_to_target from the InterpolationTargetTag. The overload without Jacobians treats the case in which TargetFrame is the same as SrcFrame.

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

: tt::ConformsTo<intrp::protocols::ComputeVarsToInterpolate> {
template <typename SrcTagList, typename DestTagList, size_t Dim>
static void apply(
const gsl::not_null<Variables<DestTagList>*> /*target_vars*/,
const Variables<SrcTagList>& /*src_vars*/, const Mesh<Dim>& /*mesh*/) {
// Already in the same frame so no need to switch frames
// Do some GR calculations to get correct variables
// Then modify target_vars
return;
}
template <typename SrcTagList, typename DestTagList, size_t Dim,
typename TargetFrame>
static void apply(
const gsl::not_null<Variables<DestTagList>*> /*target_vars*/,
const Variables<SrcTagList>& /*src_vars*/, const Mesh<Dim>& /*mesh*/,
const Jacobian<DataVector, Dim, TargetFrame,
Frame::Inertial>& /*jacobian_target_to_inertial*/,
const InverseJacobian<DataVector, Dim, TargetFrame, Frame::Inertial>&
/*inverse_jacobian_target_to_inertial*/,
const Jacobian<DataVector, 3, Frame::ElementLogical, TargetFrame>&
/*jac_logical_to_target*/,
const InverseJacobian<DataVector, 3, Frame::ElementLogical, TargetFrame>&
/*invjac_logical_to_target*/,
const tnsr::I<DataVector, 3, Frame::Inertial>& /*inertial_mesh_velocity*/,
const tnsr::I<DataVector, 3, TargetFrame>&
/*grid_to_target_frame_mesh_velocity*/) {
// Need to switch frames first
// Do some GR calculations to get correct variables
// Then modify target_vars
return;
}
// These need to exist but don't have to contain anything
using allowed_src_tags = tmpl::list<>;
using required_src_tags = tmpl::list<>;
template <typename Frame>
using allowed_dest_tags = tmpl::list<>;
template <typename Frame>
using required_dest_tags = tmpl::list<>;
};

The documentation for this struct was generated from the following file:
  • src/ParallelAlgorithms/Interpolation/Protocols/ComputeVarsToInterpolate.hpp