aboutsummaryrefslogtreecommitdiff
path: root/Carpet/CarpetRegrid2
diff options
context:
space:
mode:
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 =