Repository navigation
feat: quadtree regridding and tags from marker counts - #70
Merged
Merged
Conversation
…d tags from marker counts.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A second way for
regridto place patches:AMRHierarchy.regrid(method="quadtree", block_size=16)cuts every level into aligned square blocks ofblock_sizecells and makes a patch of each block that holds a tag. The blocks of a level are the children of those below; the nesting margin is propagated down so the tree is balanced. Blocks at the edge of the domain (an L) or of forbidden cells are cut to their allowed cells.quadtree_boxesreturns the boxes on their own. Everything downstream (halos, transfer, markers, solvers) is unchanged, since the result is an ordinary properly nested hierarchy.marker_tags(hierarchy, x, y, per_cell=..., levels=...)tags the cells holding more thanper_cellmarkers, counted over all ranks, for refinement driven by marker counts (like a particle tree's leaf capacity).New tutorial "Quadtree patches": cluster vs quadtree on the same tags, the parent/child structure, a marker-count mesh with a deposit and a nodal Poisson solve on it, and a moving beam. Following the beam, the quadtree (block 8) keeps ~88% of its patches per regrid against ~0% for the clusters, for about the same number of refined cells, but with ~20x more patches.
Checklist
pre-commit runandpytestpass (718 passed locally; the new tests also undermpirun -n 2/3/4)docs/, tutorials orREADME.qmd) are updated where the behaviour changedfeat:,fix:,docs:, ...)