Submesh + MeshHierarchy#5084
Closed
pbrubeck wants to merge 1 commit into
Closed
Conversation
pbrubeck
commented
May 7, 2026
|
|
||
| if isinstance(mesh, firedrake.MeshSequence): | ||
| result = [] | ||
| for m in mesh: |
Contributor
Author
There was a problem hiding this comment.
We need to sort the meshes in the MeshSequence by ancenstry. The parent hierarchy must be constructed before that of the children.
003f924 to
a886c07
Compare
pefarrell
added a commit
that referenced
this pull request
May 7, 2026
Replace the implicit Submesh(mh[-1], ...) approach with Pablo's explicit MeshHierarchy(submesh, nref) API. Three architectural changes: * mesh.py: Drop _create_submesh_raw; inline the body back into Submesh and store _submesh_label_name / _submesh_label_value / _submesh_ignore_halo so that MeshHierarchy can replay the same filter on each parent level. * mg/mesh.py: Add MeshSequence support at the top of MeshHierarchy (builds independent hierarchies for each component, wraps fine meshes in MeshSequenceGeometry). Add submesh_parent branch: for a Submesh, re-apply dmcommon.submesh_create to each level of the pre-existing parent hierarchy rather than refining the submesh DM directly. Remove the now-superseded _build_submesh_hierarchy_for_level and _submesh_coarse_to_fine_cells helpers. The coarse_to_fine_cells computation for submesh pairs is delegated to the same impl.coarse_to_fine_cells call as for volume meshes, which works because submesh_create preserves the consecutive child-numbering property. * test: Update test_submesh_mg.py to use the new explicit API (build parent hierarchy first, then call MeshHierarchy(submesh, nref)). The dmhooks.py / mg/embedded.py / mg/ufl_utils.py fixes from the previous commit are kept unchanged. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Contributor
Author
|
Closing in favour of #5083 |
pbrubeck
pushed a commit
that referenced
this pull request
May 12, 2026
Replace the implicit Submesh(mh[-1], ...) approach with Pablo's explicit MeshHierarchy(submesh, nref) API. Three architectural changes: * mesh.py: Drop _create_submesh_raw; inline the body back into Submesh and store _submesh_label_name / _submesh_label_value / _submesh_ignore_halo so that MeshHierarchy can replay the same filter on each parent level. * mg/mesh.py: Add MeshSequence support at the top of MeshHierarchy (builds independent hierarchies for each component, wraps fine meshes in MeshSequenceGeometry). Add submesh_parent branch: for a Submesh, re-apply dmcommon.submesh_create to each level of the pre-existing parent hierarchy rather than refining the submesh DM directly. Remove the now-superseded _build_submesh_hierarchy_for_level and _submesh_coarse_to_fine_cells helpers. The coarse_to_fine_cells computation for submesh pairs is delegated to the same impl.coarse_to_fine_cells call as for volume meshes, which works because submesh_create preserves the consecutive child-numbering property. * test: Update test_submesh_mg.py to use the new explicit API (build parent hierarchy first, then call MeshHierarchy(submesh, nref)). The dmhooks.py / mg/embedded.py / mg/ufl_utils.py fixes from the previous commit are kept unchanged. Co-Authored-By: Claude Sonnet 4.6 <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