Skip to content

Refactor AmrMesh::MakeNewGrids#5269

Draft
WeiqunZhang wants to merge 2 commits intoAMReX-Codes:developmentfrom
WeiqunZhang:regrid_proj
Draft

Refactor AmrMesh::MakeNewGrids#5269
WeiqunZhang wants to merge 2 commits intoAMReX-Codes:developmentfrom
WeiqunZhang:regrid_proj

Conversation

@WeiqunZhang
Copy link
Copy Markdown
Member

The refactor addresses two issues.

First, there was a bug when projecting grids during regrid. TagBoxArray might not have enough ghost cells to guarantee proper nesting when the new fine level grows by a lot.

Second, it could be very inefficient to use the previous approach of adding extra ghost cells to TagBoxArray for proper nesting. In some users' cases, it may need more than 30 ghost cells.

In the new approach, instead of using extra ghost cells, we explicitly add the projected tags outside the TagBoxArray's domain.

@asalmgren asalmgren self-requested a review April 5, 2026 00:21
@WeiqunZhang
Copy link
Copy Markdown
Member Author

See Discussions at #5261 and PR #5267. This supersedes #5267.

The refactor addresses two issues.

First, there was a bug when projecting grids during regrid. TagBoxArray
might not have enough ghost cells to guarantee proper nesting when the new
fine level grows by a lot.

Second, it could be very inefficient to use the previous approach of adding
extra ghost cells to TagBoxArray for proper nesting. In some users' cases,
it may need more than 30 ghost cells.

In the new approach, instead of using extra ghost cells, we explicitly add
the projected tags outside the TagBoxArray's domain.
@WeiqunZhang
Copy link
Copy Markdown
Member Author

@desjardi I have convinced myself this is the right fix. The other PR also works, but at a greater cost of using too many ghost cells. Could you give this a test? Thanks!

@WeiqunZhang
Copy link
Copy Markdown
Member Author

@zingale @BenWibking Could you fire up your regression tests? Thanks! 🙏

@WeiqunZhang
Copy link
Copy Markdown
Member Author

/run-hpsf-gitlab-ci

@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 5, 2026

GitLab CI has started at https://gitlab.spack.io/amrex/amrex/-/pipelines/1509292.

@amrex-gitlab-ci-reporter
Copy link
Copy Markdown

GitLab CI 1509292 finished with status: failed. See details at https://gitlab.spack.io/amrex/amrex/-/pipelines/1509292.

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.

3 participants