mark_entities does not refresh the cached unique_markers of facet sets
Maintainer thường phản hồi trong vòng 1 ngày
@pbrubeck đang làm issue này rồi.
Từ ngày 23/9/2026.
Đánh giá
Issue này chưa được đánh giá.
Mô tả
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.
- Ngôn ngữ chính
- Python
- Star
- 684
- Fork
- 204
- Merge trung bình
- 4 ngày 14 giờ
- Pull request đã merge (30 ngày)
- 46
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Không có hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của firedrakeproject/firedrake
-
BUG: NonlinearVariationalSolver errors with adj_kwargsCó thể đã có người làm @dham đã nhận 151 ngày trước. Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
firedrakeproject/firedrake#5186 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
firedrakeproject/firedrake#5091 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
documentation
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 82/100
firedrakeproject/firedrake#3556 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 22/100
firedrakeproject/firedrake#5644 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Function.assign on a subset fails with a Constant, a Real Function or abs in the expressionCó thể đã có người làm @connorjward đã nhận 2 ngày trước. Đang mở
firedrakeproject/firedrake#5643 · 1 người được giao ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của firedrakeproject/firedrake
Issue tương tự
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 74/100
datamodel-code-generator/datamodel-code-generator#6906 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 66/100
UKGovernmentBEIS/optstop#12 ·
-
bug good first issue severity: low
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 85/100
TMHSDigital/Awesome-Ads#37 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
smokin-salmon/smoked-salmon#1095 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
Sienna-Platform/SiennaSchemas#130 ·
Maintainer thường phản hồi trong vòng 3 ngày