Repository navigation
Conversation
This was referenced Jun 29, 2026
pbrubeck
marked this pull request as draft
November 24, 2026 15:19
…on-names # Conflicts: # demos/netgen/netgen_mesh.py.rst # firedrake/bcs.py # firedrake/mesh.py # firedrake/tsfc_interface.py
FEniCS/ufl#493 has been merged, so CI's UFL main already supports string subdomain ids. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Resolve region names once in compile_form, before the cached _compile_form, instead of in both the hashkey and the body. - Use UFL's integral type tables to find the entity dimension. - Share one entity dimension check between rename_subdomain and parse_subdomain_id, and flatten the parse_subdomain_id helpers. - Read Gmsh physical names on rank 0 only, stop at $Entities/$Nodes when there is no $PhysicalNames block, and gather names on the internal communicator. - Declare region_names on ExtrudedMeshTopology, which does not call AbstractMeshTopology.__init__. - Remove a leftover print(labels) from the Netgen demo. - Move the tests from test_region_names.py (deleted in the previous commit) into the existing test files for each feature. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Assisted-by: OpenAI Codex
Share one helper between the Gmsh and Exodus readers, give every rank the full CGNS name list, store region names in a plain dict, and read Netgen names next to the other readers. Wrap a string subdomain before the names are resolved in DirichletBC and RestrictedFunctionSpace, so that a name given to an already restricted space is also resolved. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pbrubeck
marked this pull request as ready for review
November 27, 2026 01:52
pbrubeck
commented
Nov 27, 2026
Use the terms of the rest of the codebase: subdomain names and subdomain ids, not region names, tags or markers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ngsPETSc now marks each named Netgen region in a DMPlex label with that name, like the PETSc Gmsh reader does. Read these labels in the same way for Gmsh and Netgen meshes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Drop this commit once NGSolve/ngsPETSc#134 merges. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Convert point coordinates to a tuple before passing them to DirichletBC, and demonstrate vector-valued Constants in both demos. Assisted-by: OpenAI Codex
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
Users can now refer to a subdomain by its name instead of its integer subdomain id. The names come from the mesh file, or from
mesh.rename_subdomain.The mesh readers put each name on the DMPlex as a label, and Firedrake stores the names on the mesh topology. Firedrake changes names into subdomain ids where each API reads them:
on_boundary,everywhere,otherwise,topandbottomkeep their meaning.ValueErrorthat lists the available names.compile_formchanges names into subdomain ids before the cache lookup. So the cache key holds the subdomain ids that the names map to when the form is compiled.GetRegionNames.Implementation details
-dm_plex_gmsh_use_regions -dm_plex_gmsh_use_generic. The generic labels (Cell Sets,Face Setsand so on) supply the subdomain ids as before. The name labels are removed before distribution.Cell Setslabel when all cells are in one named region. Without it,dx("fluid_domain")in the code block above resolves todx(1)and integrates over nothing.Limitations
CheckpointFiledoes not keep the names, because they are not on the DMPlex after distribution.Evidence
The tests compare assembled values or subdomain ids with values computed in a different way:
After: each test passes.
test_dirichletbc_accepts_subdomain_nametest_restricted_function_space_accepts_subdomain_nametest_submesh_accepts_subdomain_nametest_measure_accepts_subdomain_name_with_domain,..._with_inferred_domaintest_gmsh_subdomain_names_are_loaded,test_cgns_subdomain_names,test_netgen_subdomain_names_are_loaded,test_exodus_meshtest_netgen_subdomain_names_are_loadedfails with ngsPETScmainand passes with the ngsPETSc branch.Merge Danger
Door: two-way
Integer subdomain ids work as before. Names are new API. They can stay, or they can be removed later.
Blast Radius: mesh-loading
depth,celltype,marker,Cell Sets, ...) is not imported.DROP BEFORE MERGE: Install the ngsPETSc branch with region labelsinstalls the ngsPETSc branch in CI. Drop it after Add a label for each named Netgen region to the DMPlex NGSolve/ngsPETSc#134 merges, and run CI again.🤖 Generated with Claude Code