Skip to content

Mesh redistribution support (split from #5215)#5270

Open
pbrubeck wants to merge 2 commits into
pbrubeck/mg-redistfrom
pbrubeck/mesh-redistribution
Open

Mesh redistribution support (split from #5215)#5270
pbrubeck wants to merge 2 commits into
pbrubeck/mg-redistfrom
pbrubeck/mesh-redistribution

Conversation

@pbrubeck

@pbrubeck pbrubeck commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Introduces firedrake/redist.py and the redistribute=/RedistributedMeshTransfer support in MeshHierarchy, AdaptiveMeshHierarchy, and refine_marked_elements.

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

🤖 Generated with Claude Code

Reintroduce firedrake/redist.py and the RedistributedMeshTransfer-based
support for redistributing refined/adaptively-refined meshes to avoid
empty MPI ranks, threaded through MeshHierarchy, AdaptiveMeshHierarchy,
and refine_marked_elements.

Split out of pbrubeck/mg-redist (#5215) into its own branch/PR, based
on top of that branch with the redistribution support removed.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
@pbrubeck
pbrubeck requested a review from connorjward July 21, 2026 17:22
@pbrubeck
pbrubeck marked this pull request as ready for review July 22, 2026 07:17
Comment thread firedrake/mg/mesh.py
distribution_parameters=None, callbacks=None,
mesh_builder=firedrake.Mesh):
mesh_builder=firedrake.Mesh,
redistribute=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.

Do we want this to be a kwarg or should we just read it from distribution_parameters?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think distribution_parameters is a different thing that is associated with one mesh in particular. I don't think it should go in there.

Comment on lines +98 to +99

u_coarse = Function(V_coarse).interpolate(expr_coarse)

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.

Suggested change
u_coarse = Function(V_coarse).interpolate(expr_coarse)
# test prolong CG1
u_coarse = Function(V_coarse).interpolate(expr_coarse)

Comment on lines +103 to +104

r_fine = assemble(conj(TestFunction(V_fine)) * dx)

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.

Suggested change
r_fine = assemble(conj(TestFunction(V_fine)) * dx)
# test restrict CG1
r_fine = assemble(conj(TestFunction(V_fine)) * dx)

Comment on lines +113 to +114

u_coarse_injected = Function(V_coarse)

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.

Suggested change
u_coarse_injected = Function(V_coarse)
# test inject CG1
u_coarse_injected = Function(V_coarse)

@connorjward

Copy link
Copy Markdown
Contributor

Is this ready for review? You seem to still be working on it.

@pbrubeck

Copy link
Copy Markdown
Contributor Author

Is this ready for review? You seem to still be working on it.

It is ready you can review it, but ideally we should merge #5213 and #5215 first.

I'm adding the review suggestions from the meeting, and I have a genuine question: should we introduce a new redistribute kwarg or should we pass it through the distribution_parameters?

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.

2 participants