Mesh Adaptivity via DMPlexTransform - #5215
Merged
Merged
Conversation
pbrubeck
force-pushed
the
pbrubeck/mg-redist
branch
2 times, most recently
from
July 3, 2026 19:51
404f925 to
381f544
Compare
pbrubeck
force-pushed
the
pbrubeck/mg-redist
branch
from
July 3, 2026 19:56
381f544 to
885a7eb
Compare
pbrubeck
commented
Jul 3, 2026
pbrubeck
commented
Jul 5, 2026
pbrubeck
commented
Jul 5, 2026
pbrubeck
commented
Jul 5, 2026
pbrubeck
commented
Jul 5, 2026
pbrubeck
commented
Jul 5, 2026
pbrubeck
commented
Jul 5, 2026
pbrubeck
commented
Jul 5, 2026
Merged
Contributor
Author
|
Tests are green (modulo a known stochastic failure that we should probably skip/remove) |
A MeshHierarchy is no longer restricted to uniform refinement: add_mesh and adapt move onto HierarchyBase, so uniform and adaptive levels stack in one hierarchy. MeshHierarchy defaults to zero refinement levels, and AdaptiveMeshHierarchy becomes a deprecated shim next to it, as AdaptiveTransferManager is next to TransferManager. Cell maps are now built in add_mesh rather than stashed on the mesh behind a getattr. refine_marked_elements seeds a parent-cell label once and lets the refine_sbr transform propagate it, so after any number of rounds every fine cell still names the cell of the original mesh it descends from; that removes the per-round composition of the cell maps and the ragged inversion that rebuilt coarse_to_fine, both of which looped over every fine cell in Python. MeshGeometry declares adaptive_parent and adaptive_cell_maps in its constructor, so add_mesh can check that the maps it is given belong to the level it is stacking on instead of assuming it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
connorjward
requested changes
Jul 30, 2026
pbrubeck
commented
Jul 30, 2026
pbrubeck
commented
Jul 30, 2026
pbrubeck
commented
Jul 30, 2026
pbrubeck
commented
Jul 30, 2026
pbrubeck
commented
Jul 30, 2026
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
pbrubeck
commented
Jul 30, 2026
This was referenced Jul 30, 2026
connorjward
reviewed
Jul 31, 2026
connorjward
left a comment
Contributor
There was a problem hiding this comment.
Last thing. I am now happy with the rest of the code.
connorjward
approved these changes
Jul 31, 2026
pbrubeck
added a commit
that referenced
this pull request
Aug 5, 2026
The recorded multigrid iteration counts and convergence plot predate #5215's DMPlexTransform-based mesh adaptivity; regenerate both against current refine_marked_elements output. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Description
AI-assisted
Enables adaptivity on any simplicial mesh via
DMPlex.adaptLabel()/DMPlex.transform()Depends on https://gitlab.com/petsc/petsc/-/merge_requests/9412 (merged) which introduces 3D adaptivity
Enables
prolong/restrict/injectto natively support adaptively-refined hierarchiesDeprecate hierarchy-agnostic
AdaptiveMeshHierarchy/AdaptiveTransferManagerin favour ofMeshHierarchy/TransferManager, now with adaptivity support.