Repository navigation
BrokenMesh - #5476
Open
pbrubeck wants to merge 25 commits into
Open
BrokenMesh#5476pbrubeck wants to merge 25 commits into
pbrubeck wants to merge 25 commits into
Conversation
pbrubeck
commented
Sep 21, 2026
pbrubeck
commented
Sep 21, 2026
pbrubeck
commented
Sep 21, 2026
connorjward
reviewed
Sep 22, 2026
|
|
||
| @cython.boundscheck(False) | ||
| @cython.wraparound(False) | ||
| def create_cohesive_label(PETSc.DM dm, str label_name, PetscInt subdomain_id): |
Contributor
There was a problem hiding this comment.
We have complete_facet_labels that does a similar thing
Comment on lines
+4039
to
+4040
| CHKERR(DMPlexOrientLabel(dm.dm, cohesive)) | ||
| CHKERR(DMPlexLabelCohesiveComplete(dm.dm, cohesive, NULL, 1, PETSC_FALSE, NULL)) |
- Orient the surface on the mesh without its overlap, where DMPlexOrientLabel supports it, and copy the flips back to the parent. With a RIDGE overlap, several ranks hold a copy of the same surface facet, and DMPlexOrientLabel reports the surface as non-orientable. - Make the cohesive label validation collective, so that a rank without surface facets does not raise alone. - Declare the local facet number and orientation kernel arguments with 2 // arity entries per map entry, so that a broken facet map of arity 2 gathers one entry from each side. - Let broken cells inherit the closure ordering of their parent cells: submesh_create_cell_closure now takes the point map. - Add 3D tests for the dimension of the duplicated trace space, the crack tip, and the jump of CG and RT functions across the surface. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Place each child facet of a broken parent facet in the slot of the parent cell on its side. The transform numbers the two child facets in its own order, so the "+" side of the broken mesh could be the "-" side of the parent, and a signed jump across the surface changed sign on some ranks. - Add hexahedral cases to the trace dimension, crack tip and jump tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Orient and complete the cohesive label on an unoverlapped copy, then transfer only the completed side labels back to the parent mesh. Add a regression test that verifies the parent cones remain unchanged.
pbrubeck
commented
Sep 25, 2026
pbrubeck
force-pushed
the
pbrubeck/broken-mesh
branch
2 times, most recently
from
September 27, 2026 11:59
05b1ed7 to
caec758
Compare
pbrubeck
force-pushed
the
pbrubeck/broken-mesh
branch
from
September 27, 2026 12:46
fc5778d to
7e7a9dc
Compare
pbrubeck
force-pushed
the
pbrubeck/broken-mesh
branch
from
September 27, 2026 23:04
41c852b to
a621d35
Compare
…redrake into pbrubeck/broken-mesh
Add the junctions keyword to BrokenMesh. With junctions="split" or "unsplit", each value of subdomain_id marks a separate surface, and the surfaces are broken by one cohesive transform after another. A surface is not split where it ends, which includes where it ends on another surface. With "split", a surface that passes through a junction splits it, as for faults. With "unsplit", the junction ridges are passed to DMPlexLabelCohesiveComplete as unsplit points, so no surface splits them, as for rivers. The default, None, keeps one surface and rejects junctions. Fix three parallel defects that the junction tests expose: - Complete the cohesive label with DMPlexLabelComplete, so that a rank that sees a closure point of a surface but none of its facets also marks it. - Reduce the arity of child-parent submesh maps over the communicator, so that a rank that sees no broken facet builds the same map. - Get the subpoint IS in transform_source_points only for a DMPlex that has a subpoint map. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pbrubeck
force-pushed
the
pbrubeck/broken-mesh
branch
from
September 28, 2026 23:43
cfae941 to
1172b13
Compare
Submesh and BrokenMesh now build their output mesh through _child_mesh_from_plex(), which DomainDecomposition will also use. trans_mesh_entity_map() raises NotImplementedError when an entity of the base mesh has more than one copy on the target mesh, except for the two sides of a broken facet. Such maps arise from overlapping subdomains. Without the check, assembly receives a map with several copies per entity, which a kernel over a single entity cannot use. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A child plex inherits the pyop2_core, pyop2_owned, and pyop2_ghost labels of its parent, and mark_entity_classes() keeps existing labels. For BrokenMesh, whose transform changes the point SF, the inherited ghost points differ from the leaves of the SF, so the owned sizes and the global numbering disagree: in parallel, the assembled matrix of a BrokenMesh space does not match the assembled action. Removing these labels in _child_mesh_from_plex() lets every child mesh classify its entities from its own point SF. For Submesh, the ghost points were already right. On the two-process mesh of test_submesh_base_entity_maps, the cells of the process without ghosts are now core rather than owned. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adapt broken-mesh maps to PyOP3 while preserving point ancestry, facet-side ordering, and orientation cache updates. Assisted-by: OpenAI Codex
Filter cohesive cells after each cut and compose the parent point maps through the filtered meshes. Add regressions for independent jumps on crossing faults and consistent cohesive labels across MPI ranks. Assisted-by: OpenAI Codex (GPT-6) <codex@openai.com>
Update split-facet mapping and packing for the mesh indexing changes in main. Keep adaptive multigrid coverage for the transform source points in dmcommon. Assisted-by: OpenAI Codex (GPT-6) <codex@openai.com>
pbrubeck
force-pushed
the
pbrubeck/broken-mesh
branch
from
November 28, 2026 00:31
b4f900e to
259b323
Compare
Restore the original DMPlex cones after cohesive transforms, preserve existing labels, and select retained cells by their source points. Verify broken facet assembly through the public API and regenerate the fault elasticity demo figures. Assisted-by: OpenAI Codex (GPT-6) <codex@openai.com>
Retitle the demo "Geophysical cracks and faults with BrokenMesh", open it with an emphasis block as the other demos do, and remove the background that is not about Firedrake. Use the same direct solver for both problems, write the jump as [[u]], and use Constant for the slip parameters. Keep the plotting code in the appendix, but replace the reference, deformed and geometry figures with one figure for each problem: the deformed broken mesh next to the displacement of the ground surface. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Build the child-to-parent and the two-sided submesh maps in one branch each, and drop the temporary integral type variable. Reuse utils.unique and utils.unique_name in BrokenMesh, and fix unique_name, which added the old name to the name set, so that consecutive calls returned the same name. Count ridges from the facet cones, and exchange the ridge counts of all surfaces in one SF reduction and broadcast. Remove the ghost label only in BrokenMesh, so that Submesh keeps the entity classes from submesh_correct_entity_classes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
MeshTopology.point_sf passed the number of points where StarForest expects the communicator, so point_sf.comm was an integer in parallel. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Build the map from a parent interior facet to its two broken copies in its own cached property, so that the general submesh entity map and submesh_map_child_parent keep their form on main. Construct the broken mesh with Mesh directly instead of through a helper shared with Submesh, and rely on PETSc to reject an invalid label name or subdomain ID. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch has not been deployed
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
Add
BrokenMeshto model faults and cracks on labelled mesh facets. A continuous Galerkin function on the broken mesh can have a different value on each side of the cut. The parent mesh supplies the facet orientation for jump integrals, and aSubmeshcan carry a field such as a Lagrange multiplier on the surface.Implementation
PETSc's cohesive transform duplicates the marked facets and keeps a point map to the parent. Firedrake orders the two copies by the cells on either side of the parent facet. The broken mesh inherits the parent halo.
Evidence
The regression tests check the number of new degrees of freedom at cuts and junctions, and compare assembled jumps with exact jumps on one to three ranks. The fault-elasticity demo computes deformation from magma pressure and prescribed fault slip.
Limitations
Merge risk
The change is reversible. The shared code paths are submesh assembly and point maps for mesh hierarchies.
AI tool used was OpenAI Codex.