aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErik Schnetter <schnetter@cct.lsu.edu>2007-02-04 21:21:00 +0000
committerErik Schnetter <schnetter@cct.lsu.edu>2007-02-04 21:21:00 +0000
commit8f96c192410a07cba14436c1471b856fb37c3652 (patch)
tree4720895aacf77dd8219bd54a3a38cbe219670f5b
parent084d28ac19ede92284e4cbeecc7728752c7fccf6 (diff)
Carpet: Call postregrid bin also when only levels have been removed
Correct an error in determining whether the grid hierarchy has changed: When only levels are removed, this is now also counted as change. Call postregrid on the newly finest grid in this case. darcs-hash:20070204212111-dae7b-3447e8d8959c437616ed0e0431e13b373aa93f77.gz
-rw-r--r--Carpet/Carpet/src/Evolve.cc6
-rw-r--r--Carpet/Carpet/src/Initialise.cc6
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) {