From a2da2a5dc91bfdb3422d807d7a854b631a89bf7b Mon Sep 17 00:00:00 2001 From: Liwei Ji Date: Tue, 27 Aug 2024 10:30:02 -0400 Subject: [PATCH] CarpetX: calculate min_level start from CarpetX: calculate min_level --- CarpetX/src/schedule.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CarpetX/src/schedule.cxx b/CarpetX/src/schedule.cxx index d8bca9c14..292bc3583 100644 --- a/CarpetX/src/schedule.cxx +++ b/CarpetX/src/schedule.cxx @@ -1621,15 +1621,15 @@ int Evolve(tFleshConfig *config) { for (const auto &patchdata : ghext->patchdata) { - int min_active_level = - ghext->num_levels(); // start with regrid no levels - for (int min_level = ghext->num_levels() - 1; min_level >= 0; + int min_active_level = -1; + for (int min_level = patchdata.leveldata.size(); min_level >= 0; --min_level) if (patchdata.leveldata.at(min_level).iteration == iteration) { min_active_level = min_level; } else { break; } + assert(min_active_level != -1); const int old_numlevels = patchdata.amrcore->finestLevel() + 1; patchdata.amrcore->level_modified.clear();