diff --git a/src/ParallelAlgorithms/Interpolation/InterpolationTargetDetail.hpp b/src/ParallelAlgorithms/Interpolation/InterpolationTargetDetail.hpp index 3ad7b5b2e4f8c..9e9b97637afc6 100644 --- a/src/ParallelAlgorithms/Interpolation/InterpolationTargetDetail.hpp +++ b/src/ParallelAlgorithms/Interpolation/InterpolationTargetDetail.hpp @@ -95,17 +95,6 @@ double get_temporal_id_value(const T& id) { } CREATE_IS_CALLABLE(apply) -CREATE_IS_CALLABLE_V(apply) - -template -struct AllSimpleCallbacks; - -template -struct AllSimpleCallbacks, Box, Cache, TemporalId> - : public std::integral_constant< - bool, tmpl2::flat_all_v...>> {}; template @@ -115,8 +104,10 @@ bool apply_callbacks( const TemporalId& temporal_id) { using callbacks = typename T::post_interpolation_callbacks; constexpr bool all_simple_callbacks = - AllSimpleCallbacks::value; + tmpl::all, + tmpl::pin, + tmpl::pin>>::value; if constexpr (all_simple_callbacks) { tmpl::for_each([&](const auto callback_v) { using callback = tmpl::type_from; @@ -138,10 +129,10 @@ CREATE_HAS_STATIC_MEMBER_VARIABLE(fill_invalid_points_with) CREATE_HAS_STATIC_MEMBER_VARIABLE_V(fill_invalid_points_with) template -struct with_value; +struct fill_value_or_no_such_type; template -struct with_value { +struct fill_value_or_no_such_type { using type = NoSuchType; }; @@ -151,22 +142,21 @@ struct DoubleWrapper { }; template -struct with_value { +struct fill_value_or_no_such_type { using type = DoubleWrapper; }; template -struct get_value { - using type = - typename with_value>::type; +struct get_fill_value { + using type = typename fill_value_or_no_such_type< + Callback, has_fill_invalid_points_with_v>::type; }; template struct get_invalid_fill { using type = - tmpl::find>>, - tt::is_a>; + tmpl::filter>, + tt::is_a>; }; template @@ -206,6 +196,9 @@ void fill_invalid_points(const gsl::not_null*> box, }, box); } + } else { + (void)box; + (void)temporal_id; } } diff --git a/src/ParallelAlgorithms/Interpolation/Protocols/InterpolationTargetTag.hpp b/src/ParallelAlgorithms/Interpolation/Protocols/InterpolationTargetTag.hpp index 86229466b7a7e..99bdc476586c5 100644 --- a/src/ParallelAlgorithms/Interpolation/Protocols/InterpolationTargetTag.hpp +++ b/src/ParallelAlgorithms/Interpolation/Protocols/InterpolationTargetTag.hpp @@ -65,7 +65,7 @@ constexpr bool if_alias_exists_assert_conforms_to_v = * every element of that list conforms to the * intrp::protocols::PostInterpolationCallback protocol. Only one callback * with the signature with `gsl::not_null` for both the DataBox and - * GlobalCache (see `intrp::protocols::PostInterpolationCallback) is allowed + * GlobalCache (see `intrp::protocols::PostInterpolationCallback`) is allowed * in this list. Furthermore, if a callback with this signature is in the * list, it must also be the *only* callback in the list. After the * interpolation is complete, call this struct's `apply` function. diff --git a/tests/Unit/ParallelAlgorithms/Interpolation/Test_InterpolationTargetVarsFromElement.cpp b/tests/Unit/ParallelAlgorithms/Interpolation/Test_InterpolationTargetVarsFromElement.cpp index 1220c56f4acea..6071f4721dfc2 100644 --- a/tests/Unit/ParallelAlgorithms/Interpolation/Test_InterpolationTargetVarsFromElement.cpp +++ b/tests/Unit/ParallelAlgorithms/Interpolation/Test_InterpolationTargetVarsFromElement.cpp @@ -117,6 +117,7 @@ struct MockComputeTargetPoints } }; +// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) size_t num_callback_calls = 0; struct MockPostInterpolationCallback