Repository navigation
Conversation
Mark each entity in a label named after its Netgen region, with the region number as value, in the same way as the PETSc Gmsh reader with -dm_plex_gmsh_use_regions. Codes that read the DMPlex can then find the region names without the Netgen mesh. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pbrubeck
force-pushed
the
pbrubeck/feature/region-labels
branch
from
November 27, 2026 17:09
6c65291 to
4826742
Compare
pbrubeck
added a commit
to firedrakeproject/firedrake
that referenced
this pull request
Nov 27, 2026
Drop this commit once NGSolve/ngsPETSc#134 merges. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Cells had no Cell Sets label when they all belonged to region 1, so codes that read the DMPlex could not find the cells of a named region. Skip the cell labels only if that region has no name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Netgen can leave boundary region names empty. Restore the default name on the input mesh so callers can still select those regions after conversion. Reproduces and resolves the multicomponent demo failure in firedrakeproject/firedrake#5740.
This reverts commit 11dd8e2.
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
createPETScDMPlexnow also marks each entity in a label named after its Netgen region, with the region number as the label value. This is the same layout that the PETSc Gmsh reader creates with-dm_plex_gmsh_use_regions -dm_plex_gmsh_use_generic.Code that reads only the DMPlex can then find the region names without the Netgen mesh. For example, Firedrake can treat Netgen meshes in the same way as Gmsh meshes (firedrakeproject/firedrake#5199). The labels are distributed and checkpointed with the DMPlex.
A mesh whose cells all belong to one named region now gets a
Cell Setslabel. Before, it had no cell label, so the cells of that region could not be found from the DMPlex. In Firedrake,dx(1)on such a mesh integrated over nothing.Evidence
test_netgen_plex_has_region_name_labelsfails, because the DMPlex has noleftorrightlabel.After: it passes. For each named edge of a rectangle, the label holds only that region number, and its points are the
Face Setspoints with that number. The test runs with geometric dimension 2 and 3, so it also covers surface meshes.test_netgen_plex_labels_cells_of_one_named_regionfails, because the DMPlex has noCell Setslabel.After: it passes.
Cell Setsand thefluidlabel both hold every cell with value 1.tests/test_plex.pypasses at 1 and 2 ranks, andmake lint lint_testscores 10/10.Merge Danger
Door: two-way
Blast Radius: small
The change adds labels and changes no existing label value. Each named label holds the same points as the matching
Face Sets,Cell SetsorEdge Setsstratum, so it adds the cost of distributing that data a second time. OCC meshes in 2D name their cellsdefaultwhen no name is given, so these meshes now also getCell Setsanddefaultlabels on every cell. A region name that is the same as an existing label name, for examplecelltype, would add values to that label.AI tool used: Claude Code (Claude Opus 5.5).
🤖 Generated with Claude Code