diff options
-rw-r--r-- | Carpet/Carpet/src/Evolve.cc | 6 | ||||
-rw-r--r-- | Carpet/Carpet/src/Initialise.cc | 6 |
2 files changed, 9 insertions, 3 deletions
diff --git a/Carpet/Carpet/src/Evolve.cc b/Carpet/Carpet/src/Evolve.cc index e810cc334..46b3ff6fc 100644 --- a/Carpet/Carpet/src/Evolve.cc +++ b/Carpet/Carpet/src/Evolve.cc @@ -224,7 +224,10 @@ namespace Carpet { // Regrid Checkpoint ("Regrid"); + int const oldreflevels = reflevels; bool const did_regrid = Regrid (cctkGH, false); + bool const did_remove_level = reflevels < oldreflevels; + assert (not did_remove_level or did_regrid); if (did_regrid) { BEGIN_META_MODE (cctkGH) { @@ -232,7 +235,7 @@ namespace Carpet { bool const did_recompose = Recompose (cctkGH, rl, true); - if (did_recompose) { + if (did_recompose or (did_remove_level and rl == reflevels - 1)) { BEGIN_MGLEVEL_LOOP (cctkGH) { ENTER_LEVEL_MODE (cctkGH, rl) { do_global_mode = reflevel == reflevels - 1; @@ -285,6 +288,7 @@ namespace Carpet { } LEAVE_LEVEL_MODE; } END_MGLEVEL_LOOP; } // if did_recompose + } // for rl } END_META_MODE; } // if did_regrid diff --git a/Carpet/Carpet/src/Initialise.cc b/Carpet/Carpet/src/Initialise.cc index c320dad95..a3677794c 100644 --- a/Carpet/Carpet/src/Initialise.cc +++ b/Carpet/Carpet/src/Initialise.cc @@ -433,9 +433,11 @@ namespace Carpet { BEGIN_META_MODE (cctkGH) { for (int rl=0; rl<reflevels; ++rl) { - bool const did_recompose - = Recompose (cctkGH, rl, prolongate_initial_data); + bool const did_recompose = + Recompose (cctkGH, rl, prolongate_initial_data); + // Call postregridinitial only if initial data have already + // been set up if (regrid_during_initialisation and did_recompose) { BEGIN_MGLEVEL_LOOP (cctkGH) { ENTER_LEVEL_MODE (cctkGH, rl) { |