-
Notifications
You must be signed in to change notification settings - Fork 115
Adding a couple of broken tests to DivConformingFESpacesTests #1292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
0a1d952
a363ba1
6b06b5c
ba3cbd4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -294,4 +294,32 @@ test_div_v_q_equiv(U,V,P,Q,Ω) | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| end | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # This test checks that the facet owner cell criterion | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # underlying the normal sign map is consistent no matter | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # how cells sharing a facet are listed in the model. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+297
to
+299
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| # This test checks that the facet owner cell criterion | |
| # underlying the normal sign map is consistent no matter | |
| # how cells sharing a facet are listed in the model. | |
| # Desired behavior change for `NormalSignMap`: | |
| # the facet owner criterion underlying the normal sign map should | |
| # be invariant to the order in which cells sharing a facet are listed | |
| # in the model. The current documented/implemented behavior selects the | |
| # owner as the first adjacent cell in `facet_to_cell` ordering, so the | |
| # assertions below are intentionally marked `@test_broken` to document | |
| # the intended semantics rather than the current behavior. |
Copilot
AI
Apr 30, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mutating facet_cells.data here modifies the UnstructuredGridTopology cached face-to-cell table inside model (since get_faces returns the cached table). This makes the topology state of model inconsistent with how it was originally constructed and can have hard-to-debug side effects for any later use of the same model/topo (including potentially V1/uh1). Prefer building a second model/topology with the desired face-to-cell ordering (e.g., via an UnstructuredDiscreteModel with permuted connectivity) instead of in-place mutation of cached topology data.
| # how cells sharing a facet are listed in the model. | |
| @testset "NormalSignMap" begin | |
| # Create domain | |
| domain = (0,1,0,1) | |
| cells = (2,1) | |
| model = CartesianDiscreteModel(domain,cells) | |
| order = 0 | |
| reffe = ReferenceFE(raviart_thomas,Float64,order) | |
| V1 = TestFESpace(model,reffe) | |
| uh1 = FEFunction(V1,ones(num_free_dofs(V1))) | |
| topo = get_grid_topology(model) | |
| facet_cells = get_faces(topo,1,2) | |
| interior_facets = 0 | |
| for facet in 1:(length(facet_cells.ptrs)-1) | |
| first_cell = facet_cells.ptrs[facet] | |
| last_cell = facet_cells.ptrs[facet+1] - 1 | |
| if last_cell - first_cell + 1 == 2 | |
| facet_cells.data[first_cell], facet_cells.data[last_cell] = | |
| facet_cells.data[last_cell], facet_cells.data[first_cell] | |
| interior_facets += 1 | |
| end | |
| end | |
| @test interior_facets == 1 | |
| V2 = TestFESpace(model,reffe) | |
| # how cells sharing a facet are listed in the model. | |
| function _build_two_cell_quad_model(cell_to_nodes) | |
| node_coords = Point[ | |
| Point(0.0,0.0), | |
| Point(0.5,0.0), | |
| Point(1.0,0.0), | |
| Point(0.0,1.0), | |
| Point(0.5,1.0), | |
| Point(1.0,1.0), | |
| ] | |
| cell_reffe = ReferenceFE(lagrangian,Float64,1) | |
| return UnstructuredDiscreteModel(node_coords,cell_to_nodes,cell_reffe) | |
| end | |
| @testset "NormalSignMap" begin | |
| # Create two equivalent models whose cells are listed in opposite order. | |
| # This exercises facet-to-cell ordering without mutating cached topology. | |
| cell_to_nodes_1 = [ | |
| [1,2,5,4], | |
| [2,3,6,5], | |
| ] | |
| cell_to_nodes_2 = [ | |
| [2,3,6,5], | |
| [1,2,5,4], | |
| ] | |
| model1 = _build_two_cell_quad_model(cell_to_nodes_1) | |
| model2 = _build_two_cell_quad_model(cell_to_nodes_2) | |
| order = 0 | |
| reffe = ReferenceFE(raviart_thomas,Float64,order) | |
| V1 = TestFESpace(model1,reffe) | |
| uh1 = FEFunction(V1,ones(num_free_dofs(V1))) | |
| V2 = TestFESpace(model2,reffe) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The NEWS entry reads like this change happened “Since PR #1292”, but the tests are being added in this PR; PR #1292 seems to be the regression point. Consider rewording to something like “Added broken tests tracking a regression introduced in PR #1292” (and optionally align with the usual spacing style
PR [#1292]).