Skip to content

Commit

Permalink
Empty level fix (#3517)
Browse files Browse the repository at this point in the history
## Summary

Closes #3516 . This works for me in practice, and is more convenient
than filtering the levels on the caller's side.

## Additional background

Idea is to simply not consider the empty levels in the linear solver.
  • Loading branch information
sw561 authored Aug 26, 2023
1 parent d4761e8 commit c45770c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion Src/LinearSolvers/MLMG/AMReX_MLLinOp.H
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,12 @@ MLLinOpT<MF>::defineGrids (const Vector<Geometry>& a_geom,
{
BL_PROFILE("MLLinOp::defineGrids()");

m_num_amr_levels = static_cast<int>(a_geom.size());
m_num_amr_levels = 0;
for (int amrlev = 0; amrlev < a_geom.size(); amrlev++) {
if (!a_grids[amrlev].empty()) {
m_num_amr_levels++;
}
}

m_amr_ref_ratio.resize(m_num_amr_levels);
m_num_mg_levels.resize(m_num_amr_levels);
Expand Down

0 comments on commit c45770c

Please sign in to comment.