From aff1543fe0db8bbda76f08a8ab8b69ac9d407764 Mon Sep 17 00:00:00 2001 From: ih Date: Wed, 23 Feb 2005 14:35:00 +0000 Subject: CarpetAdaptiveRegrid: Only regrid once per iteration Because the routine now regrids all finer levels than the one on which it is called it is not necessary to regrid more than once per iteration. darcs-hash:20050223143548-0ff1f-d50f953738e11a8653e5eb98a13491b7810cf0dd.gz --- CarpetDev/CarpetAdaptiveRegrid/src/CAR.cc | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'CarpetDev/CarpetAdaptiveRegrid') 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; -- cgit v1.2.3