From dacb94c130e1029515cf5ca71ff3fb5715c4cb9f Mon Sep 17 00:00:00 2001 From: William Throwe Date: Fri, 13 Dec 2024 15:18:36 -0500 Subject: [PATCH] Check FoTs are ready in ObserveConstantsPerElement Not guaranteed for events that do not use the evolved variables. --- .../Events/ObserveConstantsPerElement.hpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/src/ParallelAlgorithms/Events/ObserveConstantsPerElement.hpp b/src/ParallelAlgorithms/Events/ObserveConstantsPerElement.hpp index dbde24638441..9c903f405991 100644 --- a/src/ParallelAlgorithms/Events/ObserveConstantsPerElement.hpp +++ b/src/ParallelAlgorithms/Events/ObserveConstantsPerElement.hpp @@ -25,6 +25,7 @@ #include "Parallel/Invoke.hpp" #include "Parallel/Local.hpp" #include "Parallel/TypeTraits.hpp" +#include "ParallelAlgorithms/Actions/FunctionsOfTimeAreReady.hpp" #include "ParallelAlgorithms/EventsAndTriggers/Event.hpp" #include "Utilities/TMPL.hpp" @@ -34,6 +35,9 @@ class Domain; namespace domain::FunctionsOfTime { class FunctionOfTime; } // namespace domain::FunctionsOfTime +namespace domain::Tags { +struct FunctionsOfTime; +} // namespace domain::Tags namespace observers { class ObservationKey; enum class TypeOfObservation; @@ -45,6 +49,9 @@ class GlobalCache; namespace PUP { class er; } // namespace PUP +namespace Tags { +struct Time; +} // namespace Tags /// \endcond namespace dg::Events { @@ -98,13 +105,15 @@ class ObserveConstantsPerElement : public Event { std::pair> get_observation_type_and_key_for_registration() const; - using is_ready_argument_tags = tmpl::list<>; + using is_ready_argument_tags = tmpl::list<::Tags::Time>; template - bool is_ready(Parallel::GlobalCache& /*cache*/, - const ArrayIndex& /*array_index*/, - const Component* const /*meta*/) const { - return true; + bool is_ready(const double time, Parallel::GlobalCache& cache, + const ArrayIndex& array_index, + const Component* const component) const { + return ::domain::functions_of_time_are_ready_algorithm_callback< + ::domain::Tags::FunctionsOfTime, VolumeDim>(cache, array_index, + component, time); } void pup(PUP::er& p) override;