diff options
Diffstat (limited to 'Carpet/CarpetRegrid2/src/regrid.cc')
-rw-r--r-- | Carpet/CarpetRegrid2/src/regrid.cc | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/Carpet/CarpetRegrid2/src/regrid.cc b/Carpet/CarpetRegrid2/src/regrid.cc index c4c9fa91d..a1989d22b 100644 --- a/Carpet/CarpetRegrid2/src/regrid.cc +++ b/Carpet/CarpetRegrid2/src/regrid.cc @@ -1140,11 +1140,12 @@ namespace CarpetRegrid2 { for (int n = 0; n < num_centres; ++ n) { if (active[n]) { CCTK_VInfo (CCTK_THORNSTRING, - "Centre %d is at position [%g,%g,%g]", + "Centre %d is at position [%g,%g,%g] with %d levels", n + 1, static_cast <double> (position_x[n]), static_cast <double> (position_y[n]), - static_cast <double> (position_z[n])); + static_cast <double> (position_z[n]), + static_cast <int> (num_levels[n])); } else { CCTK_VInfo (CCTK_THORNSTRING, "Centre %d is not active", n + 1); @@ -1321,11 +1322,12 @@ namespace CarpetRegrid2 { for (int n = 0; n < num_centres; ++ n) { if (active[n]) { CCTK_VInfo (CCTK_THORNSTRING, - "Centre %d is at position [%g,%g,%g]", + "Centre %d is at position [%g,%g,%g] with %d levels", n + 1, static_cast <double> (position_x[n]), static_cast <double> (position_y[n]), - static_cast <double> (position_z[n])); + static_cast <double> (position_z[n]), + static_cast <int> (num_levels[n])); } else { CCTK_VInfo (CCTK_THORNSTRING, "Centre %d is not active", n + 1); @@ -1343,6 +1345,17 @@ namespace CarpetRegrid2 { do_recompose = false; for (int n = 0; n < num_centres; ++ n) { + // When debugging, sneakily add a new level, but skip the + // initial regrid, and the regrid before the first time step + if (add_levels_automatically and cctk_iteration > 1) { + num_levels[n] = min (num_levels[n] + 1, maxreflevels); + CCTK_VInfo (CCTK_THORNSTRING, + "Increasing number of levels of centre %d to %d (it=%d)", + n + 1, + static_cast <int> (num_levels[n]), + cctk_iteration); + } + // Regrid if a region became active or inactive do_recompose = active[n] != old_active[n]; if (do_recompose) break; |