aboutsummaryrefslogtreecommitdiff
path: root/CarpetDev
diff options
context:
space:
mode:
authorih <schnetter@cct.lsu.edu>2005-02-23 14:35:00 +0000
committerih <schnetter@cct.lsu.edu>2005-02-23 14:35:00 +0000
commitaff1543fe0db8bbda76f08a8ab8b69ac9d407764 (patch)
tree21221050d20a3d78e68615ab1509ae344f41eb5a /CarpetDev
parent78b1f2df0b1b45d00ba9cbb172790d5d675348bb (diff)
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
Diffstat (limited to 'CarpetDev')
-rw-r--r--CarpetDev/CarpetAdaptiveRegrid/src/CAR.cc9
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;