Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow multiple post interpolation callbacks #5569

Merged
merged 2 commits into from
Oct 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/ControlSystem/Measurements/BothHorizons.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ struct BothHorizons : tt::ConformsTo<protocols::Measurement> {
using compute_target_points =
intrp::TargetPoints::ApparentHorizon<InterpolationTarget,
::Frame::Distorted>;
using post_interpolation_callback =
intrp::callbacks::FindApparentHorizon<InterpolationTarget,
::Frame::Distorted>;
using post_interpolation_callbacks =
tmpl::list<intrp::callbacks::FindApparentHorizon<InterpolationTarget,
::Frame::Distorted>>;
using horizon_find_failure_callback =
intrp::callbacks::ErrorOnFailedApparentHorizon;
using post_horizon_find_callbacks =
Expand Down
10 changes: 5 additions & 5 deletions src/ControlSystem/Measurements/CharSpeed.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ struct CharSpeed : tt::ConformsTo<protocols::Measurement> {
DataVector, 3, Frame::Distorted>>;
using compute_target_points =
intrp::TargetPoints::Sphere<InterpolationTarget, ::Frame::Grid>;
using post_interpolation_callback =
control_system::RunCallbacks<Excision, ControlSystems>;
using post_interpolation_callbacks =
tmpl::list<control_system::RunCallbacks<Excision, ControlSystems>>;

template <typename Metavariables>
using interpolating_component =
Expand Down Expand Up @@ -169,9 +169,9 @@ struct CharSpeed : tt::ConformsTo<protocols::Measurement> {
using compute_target_points =
intrp::TargetPoints::ApparentHorizon<InterpolationTarget,
::Frame::Distorted>;
using post_interpolation_callback =
intrp::callbacks::FindApparentHorizon<InterpolationTarget,
::Frame::Distorted>;
using post_interpolation_callbacks =
tmpl::list<intrp::callbacks::FindApparentHorizon<InterpolationTarget,
::Frame::Distorted>>;
using horizon_find_failure_callback =
intrp::callbacks::ErrorOnFailedApparentHorizon;
using post_horizon_find_callbacks =
Expand Down
6 changes: 3 additions & 3 deletions src/ControlSystem/Measurements/SingleHorizon.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,9 @@ struct SingleHorizon : tt::ConformsTo<protocols::Measurement> {
using compute_target_points =
intrp::TargetPoints::ApparentHorizon<InterpolationTarget,
::Frame::Distorted>;
using post_interpolation_callback =
intrp::callbacks::FindApparentHorizon<InterpolationTarget,
::Frame::Distorted>;
using post_interpolation_callbacks =
tmpl::list<intrp::callbacks::FindApparentHorizon<InterpolationTarget,
::Frame::Distorted>>;
using horizon_find_failure_callback =
intrp::callbacks::ErrorOnFailedApparentHorizon;
using post_horizon_find_callbacks = tmpl::list<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,11 +170,11 @@ struct EvolutionMetavars {
CurvedScalarWave::Tags::PsiSquared, ::Frame::Inertial>>;
using compute_target_points =
intrp::TargetPoints::Sphere<SphericalSurface, ::Frame::Inertial>;
using post_interpolation_callback =
intrp::callbacks::ObserveTimeSeriesOnSurface<
using post_interpolation_callbacks =
tmpl::list<intrp::callbacks::ObserveTimeSeriesOnSurface<
tmpl::list<gr::surfaces::Tags::SurfaceIntegralCompute<
CurvedScalarWave::Tags::PsiSquared, ::Frame::Inertial>>,
SphericalSurface>;
SphericalSurface>>;
template <typename metavariables>
using interpolating_component = typename metavariables::dg_element_array;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@ struct EvolutionMetavars {
using compute_target_points =
intrp::TargetPoints::LineSegment<PsiAlongAxis<Number>, volume_dim,
Frame::Grid>;
using post_interpolation_callback =
intrp::callbacks::ObserveLineSegment<vars_to_interpolate_to_target,
PsiAlongAxis<Number>>;
using post_interpolation_callbacks =
tmpl::list<intrp::callbacks::ObserveLineSegment<
vars_to_interpolate_to_target, PsiAlongAxis<Number>>>;
template <typename metavariables>
using interpolating_component = typename metavariables::dg_element_array;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,10 @@ struct EvolutionMetavars : public GeneralizedHarmonicTemplateBase<3>,
using compute_items_on_target = tmpl::list<>;
using compute_target_points =
intrp::TargetPoints::Sphere<CceWorldtubeTarget, ::Frame::Inertial>;
using post_interpolation_callback = intrp::callbacks::SendGhWorldtubeData<
Cce::CharacteristicEvolution<EvolutionMetavars>, CceWorldtubeTarget,
DuringSelfStart, local_time_stepping>;
using post_interpolation_callbacks =
tmpl::list<intrp::callbacks::SendGhWorldtubeData<
Cce::CharacteristicEvolution<EvolutionMetavars>, CceWorldtubeTarget,
DuringSelfStart, local_time_stepping>>;
using vars_to_interpolate_to_target = interpolator_source_vars;
template <typename Metavariables>
using interpolating_component = gh_dg_element_array;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -248,8 +248,8 @@ struct EvolutionMetavars {
::ah::compute_items_on_target<volume_dim, Frame>;
using compute_target_points =
intrp::TargetPoints::ApparentHorizon<Ah, Frame>;
using post_interpolation_callback =
intrp::callbacks::FindApparentHorizon<Ah, Frame>;
using post_interpolation_callbacks =
tmpl::list<intrp::callbacks::FindApparentHorizon<Ah, Frame>>;
using horizon_find_failure_callback =
intrp::callbacks::IgnoreFailedApparentHorizon;
using post_horizon_find_callbacks = tmpl::list<
Expand Down Expand Up @@ -288,8 +288,9 @@ struct EvolutionMetavars {
gh::CharacteristicSpeedsOnStrahlkorperCompute<3, Frame::Grid>>>;
using compute_target_points =
intrp::TargetPoints::Sphere<ExcisionBoundary<Excision>, ::Frame::Grid>;
using post_interpolation_callback = intrp::callbacks::ObserveSurfaceData<
tags_to_observe, ExcisionBoundary<Excision>, ::Frame::Grid>;
using post_interpolation_callbacks =
tmpl::list<intrp::callbacks::ObserveSurfaceData<
tags_to_observe, ExcisionBoundary<Excision>, ::Frame::Grid>>;
// run_callbacks
template <typename metavariables>
using interpolating_component = typename metavariables::gh_dg_element_array;
Expand Down Expand Up @@ -578,8 +579,8 @@ struct EvolutionMetavars {
using vars_to_interpolate_to_target = source_vars_no_deriv;
using compute_target_points =
intrp::TargetPoints::Sphere<BondiSachs, ::Frame::Inertial>;
using post_interpolation_callback =
intrp::callbacks::DumpBondiSachsOnWorldtube<BondiSachs>;
using post_interpolation_callbacks =
tmpl::list<intrp::callbacks::DumpBondiSachsOnWorldtube<BondiSachs>>;
using compute_items_on_target = tmpl::list<>;
template <typename Metavariables>
using interpolating_component = gh_dg_element_array;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ struct EvolutionMetavars : public GeneralizedHarmonicTemplateBase<3> {
using compute_target_points =
intrp::TargetPoints::ApparentHorizon<ApparentHorizon,
::Frame::Inertial>;
using post_interpolation_callback =
intrp::callbacks::FindApparentHorizon<ApparentHorizon,
::Frame::Inertial>;
using post_interpolation_callbacks =
tmpl::list<intrp::callbacks::FindApparentHorizon<ApparentHorizon,
::Frame::Inertial>>;
using horizon_find_failure_callback =
intrp::callbacks::IgnoreFailedApparentHorizon;
using post_horizon_find_callbacks = tmpl::list<
Expand Down Expand Up @@ -117,9 +117,9 @@ struct EvolutionMetavars : public GeneralizedHarmonicTemplateBase<3> {
gh::CharacteristicSpeedsOnStrahlkorperCompute<3, Frame::Grid>>>;
using compute_target_points =
intrp::TargetPoints::Sphere<ExcisionBoundary, ::Frame::Grid>;
using post_interpolation_callback =
intrp::callbacks::ObserveSurfaceData<tags_to_observe, ExcisionBoundary,
::Frame::Grid>;
using post_interpolation_callbacks =
tmpl::list<intrp::callbacks::ObserveSurfaceData<
tags_to_observe, ExcisionBoundary, ::Frame::Grid>>;
// run_callbacks
template <typename metavariables>
using interpolating_component = typename metavariables::gh_dg_element_array;
Expand Down Expand Up @@ -167,7 +167,7 @@ struct EvolutionMetavars : public GeneralizedHarmonicTemplateBase<3> {
observers::collect_reduction_data_tags<tmpl::push_back<
tmpl::at<typename factory_creation::factory_classes, Event>,
typename ApparentHorizon::post_horizon_find_callbacks,
typename ExcisionBoundary::post_interpolation_callback>>;
typename ExcisionBoundary::post_interpolation_callbacks>>;

using dg_registration_list =
tmpl::push_back<typename gh_base::dg_registration_list,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,8 @@ struct EvolutionMetavars : public GhValenciaDivCleanTemplateBase<
tags_to_observe>;
using compute_target_points =
intrp::TargetPoints::ApparentHorizon<AhA, ::Frame::Inertial>;
using post_interpolation_callback =
intrp::callbacks::FindApparentHorizon<AhA, ::Frame::Inertial>;
using post_interpolation_callbacks = tmpl::list<
intrp::callbacks::FindApparentHorizon<AhA, ::Frame::Inertial>>;
using horizon_find_failure_callback =
intrp::callbacks::ErrorOnFailedApparentHorizon;
using post_horizon_find_callbacks = tmpl::list<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -975,8 +975,8 @@ struct BondiSachs : tt::ConformsTo<intrp::protocols::InterpolationTargetTag> {
typename gh::System<3>::variables_tag::tags_list;
using compute_target_points =
intrp::TargetPoints::Sphere<BondiSachs, ::Frame::Inertial>;
using post_interpolation_callback =
intrp::callbacks::DumpBondiSachsOnWorldtube<BondiSachs>;
using post_interpolation_callbacks =
tmpl::list<intrp::callbacks::DumpBondiSachsOnWorldtube<BondiSachs>>;
using compute_items_on_target = tmpl::list<>;
template <typename Metavariables>
using interpolating_component =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -645,9 +645,9 @@ struct CenterOfStar : tt::ConformsTo<intrp::protocols::InterpolationTargetTag> {
tmpl::list<MaxOfScalarCompute<hydro::Tags::RestMassDensity<DataVector>>>;
using vars_to_interpolate_to_target =
tmpl::list<hydro::Tags::RestMassDensity<DataVector>>;
using post_interpolation_callback =
intrp::callbacks::ObserveTimeSeriesOnSurface<tags_to_observe,
CenterOfStar>;
using post_interpolation_callbacks =
tmpl::list<intrp::callbacks::ObserveTimeSeriesOnSurface<tags_to_observe,
CenterOfStar>>;
using compute_target_points =
intrp::TargetPoints::SpecifiedPoints<CenterOfStar, 3>;
using compute_items_on_target = tags_to_observe;
Expand All @@ -674,9 +674,9 @@ struct KerrHorizon : tt::ConformsTo<intrp::protocols::InterpolationTargetTag> {
hydro::Tags::MassFluxCompute<DataVector, 3, ::Frame::Inertial>>;
using compute_target_points =
intrp::TargetPoints::KerrHorizon<KerrHorizon, ::Frame::Inertial>;
using post_interpolation_callback =
intrp::callbacks::ObserveTimeSeriesOnSurface<tags_to_observe,
KerrHorizon>;
using post_interpolation_callbacks =
tmpl::list<intrp::callbacks::ObserveTimeSeriesOnSurface<tags_to_observe,
KerrHorizon>>;

template <typename Metavariables>
using interpolating_component =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ struct EvolutionMetavars : public ScalarTensorTemplateBase<EvolutionMetavars> {
::ah::compute_items_on_target<volume_dim, Frame::Inertial>;
using compute_target_points =
intrp::TargetPoints::ApparentHorizon<AhA, ::Frame::Inertial>;
using post_interpolation_callback =
intrp::callbacks::FindApparentHorizon<AhA, ::Frame::Inertial>;
using post_interpolation_callbacks = tmpl::list<
intrp::callbacks::FindApparentHorizon<AhA, ::Frame::Inertial>>;
using horizon_find_failure_callback =
intrp::callbacks::IgnoreFailedApparentHorizon;
using post_horizon_find_callbacks = tmpl::list<
Expand Down Expand Up @@ -115,9 +115,9 @@ struct EvolutionMetavars : public ScalarTensorTemplateBase<EvolutionMetavars> {
Frame::Grid>>>;
using compute_target_points =
intrp::TargetPoints::Sphere<ExcisionBoundaryA, ::Frame::Grid>;
using post_interpolation_callback =
intrp::callbacks::ObserveSurfaceData<tags_to_observe, ExcisionBoundaryA,
::Frame::Grid>;
using post_interpolation_callbacks =
tmpl::list<intrp::callbacks::ObserveSurfaceData<
tags_to_observe, ExcisionBoundaryA, ::Frame::Grid>>;
// run_callbacks
template <typename metavariables>
using interpolating_component = typename metavariables::st_dg_element_array;
Expand All @@ -133,10 +133,10 @@ struct EvolutionMetavars : public ScalarTensorTemplateBase<EvolutionMetavars> {
detail::ObserverTags::scalar_charge_compute_items_on_target;
using compute_target_points =
intrp::TargetPoints::Sphere<SphericalSurface, ::Frame::Inertial>;
using post_interpolation_callback =
intrp::callbacks::ObserveTimeSeriesOnSurface<
using post_interpolation_callbacks =
tmpl::list<intrp::callbacks::ObserveTimeSeriesOnSurface<
detail::ObserverTags::scalar_charge_surface_obs_tags,
SphericalSurface>;
SphericalSurface>>;
template <typename metavariables>
using interpolating_component = typename metavariables::st_dg_element_array;
};
Expand Down
4 changes: 2 additions & 2 deletions src/Executables/FindHorizons/FindHorizons.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,8 @@ struct ApparentHorizon
using temporal_id = ::Tags::Time;
using compute_target_points =
intrp::TargetPoints::ApparentHorizon<ApparentHorizon, Frame::Inertial>;
using post_interpolation_callback =
intrp::callbacks::FindApparentHorizon<ApparentHorizon, Frame::Inertial>;
using post_interpolation_callbacks = tmpl::list<
intrp::callbacks::FindApparentHorizon<ApparentHorizon, Frame::Inertial>>;
using horizon_find_failure_callback =
intrp::callbacks::ErrorOnFailedApparentHorizon;
using post_horizon_find_callbacks = tmpl::list<
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ namespace callbacks {
/// - `::ah::Tags::FastFlow`
/// - `ylm::Tags::Strahlkorper<Frame>`
///
/// This is an InterpolationTargetTag::post_interpolation_callback;
/// This can be used in InterpolationTargetTag::post_interpolation_callbacks;
/// see intrp::protocols::InterpolationTargetTag for details on
/// InterpolationTargetTag.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ namespace Actions {
/// - Checks if functions of time are ready (if there are any). If they are not
/// ready, register a simple action callback with the GlobalCache to this
/// action.
/// - Calls `InterpolationTargetTag::post_interpolation_callback`
/// - Calls `InterpolationTargetTag::post_interpolation_callbacks`
/// - Tells `Interpolator`s that the interpolation is complete
/// (by calling
/// `Actions::CleanUpInterpolator<InterpolationTargetTag>`)
Expand Down Expand Up @@ -154,7 +154,7 @@ struct InterpolationTargetReceiveVars {
return;
}

if (InterpolationTarget_detail::call_callback<InterpolationTargetTag>(
if (InterpolationTarget_detail::call_callbacks<InterpolationTargetTag>(
make_not_null(&box), make_not_null(&cache), temporal_id)) {
InterpolationTarget_detail::clean_up_interpolation_target<
InterpolationTargetTag>(make_not_null(&box), temporal_id);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ namespace Actions {
/// - Checks if functions of time are ready (if there are any). If they are not
/// ready, register a simple action callback with the GlobalCache to this
/// action.
/// - Calls `InterpolationTargetTag::post_interpolation_callback`
/// - Calls `InterpolationTargetTag::post_interpolation_callbacks`
/// - Removes the finished `temporal_id` from `Tags::TemporalIds<TemporalId>`
/// and adds it to `Tags::CompletedTemporalIds<TemporalId>`
/// - Removes `Tags::InterpolatedVars<InterpolationTargetTag,TemporalId>`,
Expand Down Expand Up @@ -167,10 +167,10 @@ struct InterpolationTargetVarsFromElement {
return;
}
// All the valid points have been interpolated.
// We throw away the return value of call_callback in this case
// We throw away the return value of call_callbacks in this case
// (it is known to be always true; it can be false only for
// sequential interpolations, which is static-asserted against above).
InterpolationTarget_detail::call_callback<InterpolationTargetTag>(
InterpolationTarget_detail::call_callbacks<InterpolationTargetTag>(
make_not_null(&box), make_not_null(&cache), temporal_id);
InterpolationTarget_detail::clean_up_interpolation_target<
InterpolationTargetTag>(make_not_null(&box), temporal_id);
Expand Down
7 changes: 4 additions & 3 deletions src/ParallelAlgorithms/Interpolation/InterpolationTarget.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,10 @@ struct InterpolationTarget {
}
using chare_type = ::Parallel::Algorithms::Singleton;
using const_global_cache_tags =
Parallel::get_const_global_cache_tags_from_actions<tmpl::list<
typename InterpolationTargetTag::compute_target_points,
typename InterpolationTargetTag::post_interpolation_callback>>;
Parallel::get_const_global_cache_tags_from_actions<
tmpl::flatten<tmpl::list<
typename InterpolationTargetTag::compute_target_points,
typename InterpolationTargetTag::post_interpolation_callbacks>>>;
using metavariables = Metavariables;
using phase_dependent_action_list = tmpl::list<
Parallel::PhaseActions<
Expand Down
Loading