aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetRegrid2
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2006-09-25 22:11:00 +0000
committerErik Schnetter <schnetter@cct.lsu.edu>2006-09-25 22:11:00 +0000
commitf2306efcbd5b7befaad5fe8a3f21f0ed5f2de623 (patch)
tree77a8e8895f5bf507947f160144dffcb0919f34ec /Carpet/CarpetRegrid2
parenteca22ed88c8d4350761d9524f62c42a2ed559f1e (diff)
CarpetRegrid2: Update logic that decides whether to regrid
darcs-hash:20060925221156-dae7b-06282159942a5b0f624ee88398b8a7be0bcdff12.gz
Diffstat (limited to 'Carpet/CarpetRegrid2')
-rw-r--r--Carpet/CarpetRegrid2/src/regrid.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/Carpet/CarpetRegrid2/src/regrid.cc b/Carpet/CarpetRegrid2/src/regrid.cc
index 7210c9b7d..765b1f758 100644
--- a/Carpet/CarpetRegrid2/src/regrid.cc
+++ b/Carpet/CarpetRegrid2/src/regrid.cc
@@ -545,7 +545,7 @@ namespace CarpetRegrid2 {
assert (Carpet::is_level_mode());
// Decide whether to change the grid hierarchy
- // (We always do)
+ static int last_iteration = -1;
bool do_recompose;
if (force) {
do_recompose = true;
@@ -556,14 +556,16 @@ namespace CarpetRegrid2 {
do_recompose = cctkGH->cctk_iteration == 0;
} else {
do_recompose =
- reflevel == 0 and
(cctkGH->cctk_iteration == 0 or
(cctkGH->cctk_iteration > 0 and
- (cctkGH->cctk_iteration - 1) % regrid_every == 0));
+ (cctkGH->cctk_iteration - 1) % regrid_every == 0 and
+ cctkGH->cctk_iteration > last_iteration));
}
}
+ last_iteration = cctkGH->cctk_iteration;
if (do_recompose) {
+
vector <gh::mexts> & bbssss =
* static_cast <vector <gh::mexts> *> (bbssss_);
vector <gh::rbnds> & obsss =