Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix particle restart when finestLevel() < finest_level_in_file (AMReX…
…-Codes#3944) ## Summary In the restart for particles, there is a loop up to `lev = finest_level_in_file` but is accessing `ParticleDistributionMap(lev)`. In the case when `finestLevel() < finest_level_in_file`, this was causing an assertion error (with DEBUG) and a seg fault (without DEBUG). This fixes the loop to only go up to `finestLevel()`. This fixes the issue and still works properly (all of the particles are read in). This also removes the `if` block that would no longer ever be called. ## Additional background Curiously, previously it would work with `finestLevel() < finest_level_in_file`, but none of this code had changed recently. I don't know how it worked before. ## Checklist The proposed changes: - [x] fix a bug or incorrect behavior in AMReX - [ ] add new capabilities to AMReX - [ ] changes answers in the test suite to more than roundoff level - [ ] are likely to significantly affect the results of downstream AMReX users - [ ] include documentation in the code and/or rst files, if appropriate
- Loading branch information