diff options
-rw-r--r-- | CarpetDev/CarpetAdaptiveRegrid/src/CAR.cc | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/CarpetDev/CarpetAdaptiveRegrid/src/CAR.cc b/CarpetDev/CarpetAdaptiveRegrid/src/CAR.cc index f99d44e84..9c773abf7 100644 --- a/CarpetDev/CarpetAdaptiveRegrid/src/CAR.cc +++ b/CarpetDev/CarpetAdaptiveRegrid/src/CAR.cc @@ -29,6 +29,7 @@ namespace CarpetAdaptiveRegrid { using namespace Carpet; static gh::mexts local_bbsss; + static CCTK_INT last_iteration = -1; extern "C" { void CCTK_FCALL CCTK_FNAME(copy_mask) @@ -117,6 +118,14 @@ namespace CarpetAdaptiveRegrid { return 0; } + // Return if we have already been called on this iteration + if (cctkGH->cctk_iteration == last_iteration) { + return 0; + } + else { + last_iteration = cctkGH->cctk_iteration; + } + // cout << "bbsss at start" << endl << bbsss << endl; // cout << "obss at start" << endl << obss << endl; // cout << "pss at start" << endl << pss << endl; |