diff options
Diffstat (limited to 'Source')
-rw-r--r-- | Source/Initialization/WarpXInitData.cpp | 3 | ||||
-rw-r--r-- | Source/Parallelization/WarpXRegrid.cpp | 6 |
2 files changed, 6 insertions, 3 deletions
diff --git a/Source/Initialization/WarpXInitData.cpp b/Source/Initialization/WarpXInitData.cpp index 80fac1f71..be8225c81 100644 --- a/Source/Initialization/WarpXInitData.cpp +++ b/Source/Initialization/WarpXInitData.cpp @@ -647,7 +647,8 @@ WarpX::InitLevelData (int lev, Real /*time*/) } if (costs[lev]) { - for (int i : costs[lev]->IndexArray()) { + const auto iarr = costs[lev]->IndexArray(); + for (int i : iarr) { (*costs[lev])[i] = 0.0; WarpX::setLoadBalanceEfficiency(lev, -1); } diff --git a/Source/Parallelization/WarpXRegrid.cpp b/Source/Parallelization/WarpXRegrid.cpp index e2e10158e..59ca25ed3 100644 --- a/Source/Parallelization/WarpXRegrid.cpp +++ b/Source/Parallelization/WarpXRegrid.cpp @@ -408,7 +408,8 @@ WarpX::RemakeLevel (int lev, Real /*time*/, const BoxArray& ba, const Distributi if (costs[lev] != nullptr) { costs[lev] = std::make_unique<LayoutData<Real>>(ba, dm); - for (int i : costs[lev]->IndexArray()) + const auto iarr = costs[lev]->IndexArray(); + for (int i : iarr) { (*costs[lev])[i] = 0.0; setLoadBalanceEfficiency(lev, -1); @@ -464,7 +465,8 @@ WarpX::ResetCosts () { for (int lev = 0; lev <= finest_level; ++lev) { - for (int i : costs[lev]->IndexArray()) + const auto iarr = costs[lev]->IndexArray(); + for (int i : iarr) { // Reset costs (*costs[lev])[i] = 0.0; |