From 57945256c7d70016ceb1d772068b4e8526a93341 Mon Sep 17 00:00:00 2001 From: Liwei Ji Date: Sun, 18 Aug 2024 23:24:10 -0400 Subject: [PATCH] PunctureTracker: make it work in real global mode --- PunctureTracker/src/puncture_tracker.cxx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/PunctureTracker/src/puncture_tracker.cxx b/PunctureTracker/src/puncture_tracker.cxx index b76f9020..a8ec73b8 100644 --- a/PunctureTracker/src/puncture_tracker.cxx +++ b/PunctureTracker/src/puncture_tracker.cxx @@ -17,6 +17,8 @@ namespace PunctureTracker { static PunctureContainer *g_punctures = nullptr; +static double previous_time = 0.0; + const int max_num_tracked = 10; extern "C" void PunctureTracker_Init(CCTK_ARGUMENTS) { @@ -101,6 +103,13 @@ extern "C" void PunctureTracker_Track(CCTK_ARGUMENTS) { DECLARE_CCTK_ARGUMENTS_PunctureTracker_Track; DECLARE_CCTK_PARAMETERS; + // we can remove this segment when global mode works + if (cctk_time <= previous_time) { + return; + } +#pragma omp master + { previous_time = cctk_time; } + // Do not track while setting up initial data; time interpolation may fail if (cctk_iteration == 0) { return;