diff options
author | schnetter <> | 2004-06-27 08:02:00 +0000 |
---|---|---|
committer | schnetter <> | 2004-06-27 08:02:00 +0000 |
commit | 2d43e07cefaa56937fb903609e6786d8e44834ba (patch) | |
tree | 5e67c75ad16523177ed76880e96bb8c61cc8802c /Carpet | |
parent | dd92d5d080ec6638fbeec79e580243ef6af1e534 (diff) |
Execute POSTREGRID bin only if the grid hierarchy actually changed.
Execute POSTREGRID bin only if the grid hierarchy actually changed.
It is still executed for all refinement levels.
darcs-hash:20040627080242-07bb3-9d49b599f4b1ea446b2e8f5d3dcad77fff97a4c2.gz
Diffstat (limited to 'Carpet')
-rw-r--r-- | Carpet/Carpet/src/Evolve.cc | 4 | ||||
-rw-r--r-- | Carpet/Carpet/src/Initialise.cc | 22 |
2 files changed, 15 insertions, 11 deletions
diff --git a/Carpet/Carpet/src/Evolve.cc b/Carpet/Carpet/src/Evolve.cc index 724baf007..1000a857b 100644 --- a/Carpet/Carpet/src/Evolve.cc +++ b/Carpet/Carpet/src/Evolve.cc @@ -31,7 +31,7 @@ #include "carpet.hh" extern "C" { - static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/Carpet/src/Evolve.cc,v 1.48 2004/06/26 11:37:33 schnetter Exp $"; + static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/Carpet/src/Evolve.cc,v 1.49 2004/06/27 10:02:42 schnetter Exp $"; CCTK_FILEVERSION(Carpet_Carpet_Evolve_cc); } @@ -157,7 +157,7 @@ namespace Carpet { Checkpoint ("Regrid"); const bool did_change = Regrid (cgh); - if (true || did_change) { + if (did_change) { // Postregrid Checkpoint ("Scheduling POSTREGRID"); CCTK_ScheduleTraverse ("CCTK_POSTREGRID", cgh, CallFunction); diff --git a/Carpet/Carpet/src/Initialise.cc b/Carpet/Carpet/src/Initialise.cc index 382a74c60..103430b2b 100644 --- a/Carpet/Carpet/src/Initialise.cc +++ b/Carpet/Carpet/src/Initialise.cc @@ -12,7 +12,7 @@ #include "carpet.hh" extern "C" { - static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/Carpet/src/Initialise.cc,v 1.46 2004/06/02 07:11:45 bzink Exp $"; + static const char* rcsid = "$Header: /home/eschnett/C/carpet/Carpet/Carpet/Carpet/src/Initialise.cc,v 1.47 2004/06/27 10:02:42 schnetter Exp $"; CCTK_FILEVERSION(Carpet_Carpet_Initialise_cc); } @@ -106,11 +106,13 @@ namespace Carpet { // Regrid Checkpoint ("Regrid"); - Regrid (cgh, true); + const bool did_change = Regrid (cgh, true); - // Postregrid - Checkpoint ("Scheduling POSTREGRID"); - CCTK_ScheduleTraverse ("CCTK_POSTREGRID", cgh, CallFunction); + if (did_change) { + // Postregrid + Checkpoint ("Scheduling POSTREGRID"); + CCTK_ScheduleTraverse ("CCTK_POSTREGRID", cgh, CallFunction); + } leave_level_mode (cgh); leave_global_mode (cgh); @@ -220,11 +222,13 @@ namespace Carpet { // Regrid Checkpoint ("Regrid"); - Regrid (cgh); + const bool did_change = Regrid (cgh); - // Postregrid - Checkpoint ("Scheduling POSTREGRID"); - CCTK_ScheduleTraverse ("CCTK_POSTREGRID", cgh, CallFunction); + if (did_change) { + // Postregrid + Checkpoint ("Scheduling POSTREGRID"); + CCTK_ScheduleTraverse ("CCTK_POSTREGRID", cgh, CallFunction); + } leave_level_mode (cgh); leave_global_mode (cgh); |