mark_entities does not refresh the cached unique_markers of facet sets
Los mantenedores suelen responder en 1 día
@pbrubeck ya está trabajando en esto.
Desde el 23/9/2026.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Describe the bug
MeshTopology.mark_entities writes new values into the Face Sets label of the plex, but measures on the mesh do not see them. interior_facets and exterior_facets are cached_propertys, and MeshTopology._facets reads unique_markers from the Face Sets label only once, when the property is first accessed. Anything that builds the facet data before the call to mark_entities (for example, interpolating the HDiv Trace marker function that mark_entities requires) leaves unique_markers stale. A later dS(new_id) or ds(new_id) then raises LookupError, although the plex label contains new_id.
Steps to Reproduce
from firedrake import *
mesh = UnitSquareMesh(2, 2)
x, y = SpatialCoordinate(mesh)
marker = Function(FunctionSpace(mesh, "HDiv Trace", 0))
marker.interpolate(conditional(lt(abs(y - 0.5), 1e-12), 1, 0))
mesh.mark_entities(marker.topological, 99)
print("plex label values:", mesh.topology_dm.getLabelIdIS("Face Sets").indices)
print("interior markers:", mesh.interior_facets.unique_markers)
print(assemble(Constant(1) * dS(99, domain=mesh)))
Expected behavior
The script prints the length of the line y = 1/2, which is 1.0.
Error message
plex label values: [ 3 2 4 1 99]
interior markers: [1 2 3 4]
...
File ".../firedrake/mesh.py", line 265, in subset
raise LookupError("{0} are not a valid markers (not in {1})".format(invalid, self.unique_markers))
LookupError: {99} are not a valid markers (not in [1 2 3 4])
Environment
Firedrake main at 065b77334. The facet-marker code path in firedrake/mesh.py is the same on main and on the branch where this was found.
Additional Info
RelabeledMesh(mesh, [marker], [99]) does not have this problem, because it creates a new mesh whose facet data is built after the label is set. Possible fixes are to invalidate the cached interior_facets/exterior_facets (and their marker subsets) inside mark_entities, or to compute unique_markers from the label each time it is needed.
This issue was written by Claude (Claude Code) on behalf of @pbrubeck.
- Lenguaje dominante
- Python
- Estrellas
- 684
- Forks
- 204
- Merge medio
- 4 d 14 h
- PR fusionados (30 d)
- 46
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Sin guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de firedrakeproject/firedrake
-
BUG: NonlinearVariationalSolver errors with adj_kwargsPosiblemente ocupada @dham la tomó hace 151 días. Abiertobug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
firedrakeproject/firedrake#5186 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
firedrakeproject/firedrake#5091 ·
Los mantenedores suelen responder en 1 día
-
documentation
Dificultad 1/5 1-3 horas Aptitud para principiantes 82/100
firedrakeproject/firedrake#3556 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 22/100
firedrakeproject/firedrake#5644 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Function.assign on a subset fails with a Constant, a Real Function or abs in the expressionPosiblemente ocupada @connorjward la tomó hace 2 días. Abierto
firedrakeproject/firedrake#5643 · 1 asignado ·
Los mantenedores suelen responder en 1 día
Todos los issues de firedrakeproject/firedrake
Issues similares
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Sienna-Platform/SiennaSchemas#130 ·
Los mantenedores suelen responder en 3 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 85/100
firedrakeproject/Irksome#293 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
ida-arbeitszeit/workers-control#1578 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
aws-samples/sample-per-model-bedrock#898 ·
Los mantenedores suelen responder en 1 día