Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty level fix #3517

Merged
merged 3 commits into from
Aug 26, 2023
Merged

Empty level fix #3517

merged 3 commits into from
Aug 26, 2023

Conversation

sw561
Copy link
Contributor

@sw561 sw561 commented Aug 26, 2023

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.

Checklist

The proposed changes:

  • 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

@WeiqunZhang
Copy link
Member

One is expected to use the following AmrMesh functions to get objects for the linear solver.

Vector<Geometry> Geom (int a_coarsest_lev, int a_finest_lev) const
Vector<BoxArray> boxArray (int a_coarsest_lev, int a_finest_lev) const
Vector<DistributionMapping> DistributionMap (int a_coarsest_lev, int a_finest_lev) const

And if the coarsest level for the solver is not AMR level 0, the versions without arguments that get the objects starting from AMR level 0 will always be wrong.

I am not sure if we should try to guess the user's intention or add an assertion making sure BoxArrays are not empty. Let me think about this.

@WeiqunZhang WeiqunZhang merged commit c45770c into AMReX-Codes:development Aug 26, 2023
66 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Coarsenable assertion fails on empty level in AMREX_MLLinOp.H
2 participants