Skip to content

Mesh Adaptivity via DMPlexTransform #5215

Draft
pbrubeck wants to merge 53 commits into
pbrubeck/snes-adaptfrom
pbrubeck/mg-redist
Draft

Mesh Adaptivity via DMPlexTransform #5215
pbrubeck wants to merge 53 commits into
pbrubeck/snes-adaptfrom
pbrubeck/mg-redist

Conversation

@pbrubeck

@pbrubeck pbrubeck commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

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/inject to natively support adaptively-refined/redistributed hierarchies

Deprecate hierarchy-agnostic AdaptiveTransferManager in favour of TransferManager, now with adaptivity and parallel redistribution support.

RedistributedMeshTransfer was borrowed from @wence-'s unmerged branch main...wence/feature/redist-mg

@pbrubeck pbrubeck changed the title Native support for redistributed AdaptiveMeshHierarchy TransferManager: support a redistributed AdaptiveMeshHierarchy Jul 3, 2026
@pbrubeck pbrubeck force-pushed the pbrubeck/mg-redist branch 2 times, most recently from 404f925 to 381f544 Compare July 3, 2026 19:51
@pbrubeck pbrubeck force-pushed the pbrubeck/mg-redist branch from 381f544 to 885a7eb Compare July 3, 2026 19:56
Comment thread firedrake/mg/interface.py Outdated
Comment thread firedrake/mg/adaptive_hierarchy.py Outdated
Comment thread firedrake/netgen.py Outdated
Comment thread firedrake/netgen.py Outdated
Comment thread firedrake/netgen.py Outdated
Comment thread firedrake/netgen.py Outdated
Comment thread firedrake/mg/utils.py Outdated
Comment thread firedrake/mg/utils.py Outdated
Comment thread firedrake/mg/utils.py Outdated
Comment thread firedrake/mg/utils.py Outdated
Comment thread firedrake/mg/mesh.py Outdated
Comment thread firedrake/mg/mesh.py Outdated
Comment thread firedrake/mg/mesh.py Outdated
Comment thread firedrake/mg/mesh.py
Comment thread firedrake/redist.py Outdated
Comment thread firedrake/redist.py
return dm


def redistribute_dm(dm, parameters, grow_overlap=True):

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add docstring

Comment thread firedrake/adapt.py Outdated
Comment thread firedrake/mg/mesh.py Outdated
Comment thread firedrake/mg/mesh.py Outdated
pbrubeck added 2 commits July 10, 2026 10:52
Co-authored-by: Pablo Brubeck <brubeck@protonmail.com>
Comment thread firedrake/mg/mesh.py Outdated
Comment thread firedrake/mg/mesh.py Outdated
Comment thread firedrake/mg/mesh.py Outdated
Co-authored-by: Pablo Brubeck <brubeck@protonmail.com>
Comment thread firedrake/mg/mesh.py Outdated
Comment thread firedrake/mg/mesh.py Outdated
Co-authored-by: Pablo Brubeck <brubeck@protonmail.com>
Comment thread firedrake/mg/mesh.py Outdated
@pbrubeck pbrubeck changed the title TransferManager: support a redistributed AdaptiveMeshHierarchy Mesh Adaptivity via DMPlexTransform Jul 10, 2026
Comment thread firedrake/adapt.py
parent_label = dm.getLabel(parent_name)
adapt_label = dm.getLabel(adapt_name)
marks = cell_marker.dat.data_ro
for c in range(*dm.getHeightStratum(0)):

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cythonize

Comment thread firedrake/adapt.py
nfine = new_mesh.cell_set.size
fine_to_coarse = np.full((nfine, 1), -1, dtype=IntType)
children = [[] for _ in range(ncoarse)]
for c in range(*new_dm.getHeightStratum(0)):

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cythonize

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.

1 participant