From 0a1d9528ab9a49e355201b5316aecfaec35927fd Mon Sep 17 00:00:00 2001 From: "Alberto F. Martin" Date: Thu, 30 Apr 2026 09:43:53 +1000 Subject: [PATCH 1/4] Adding a couple of broken tests to DivConformingFESpacesTests. These will be sorted out soon in another branch. --- NEWS.md | 3 ++ .../DivConformingFESpacesTests.jl | 28 +++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/NEWS.md b/NEWS.md index 4a9476cfd..64a1cb80c 100644 --- a/NEWS.md +++ b/NEWS.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Added +- A couple of broken tests in DivConformingFESpacesTests.jl related to NormalSignMap facet cell owners default criterion. Since PR[#XXX](https://github.com/gridap/Gridap.jl/pull/XXX) + ## [0.20.5] - 2026-04-28 ### Fixed diff --git a/test/FESpacesTests/DivConformingFESpacesTests.jl b/test/FESpacesTests/DivConformingFESpacesTests.jl index 2d5c72e99..b85059056 100644 --- a/test/FESpacesTests/DivConformingFESpacesTests.jl +++ b/test/FESpacesTests/DivConformingFESpacesTests.jl @@ -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. +@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,rand(num_free_dofs(V1))) + + topo = get_grid_topology(model) + facet_cells = get_faces(topo,1,2) + facet_cells.data[4]=2 + facet_cells.data[5]=1 + V2 = TestFESpace(model,reffe) + uh2 = FEFunction(V2,get_free_dof_values(uh1)) + + data_uh1 = get_data(uh1) + data_uh2 = get_data(uh2) + + @test_broken evaluate(data_uh1[1],[Point(0.5,0.5)])[1] ≈ evaluate(data_uh2[1],[Point(0.5,0.5)])[1] + @test_broken evaluate(data_uh1[2],[Point(0.5,0.5)])[1] ≈ evaluate(data_uh2[2],[Point(0.5,0.5)])[1] +end + end # module From a363ba19be37a5264fd0093926ec37d43f179ab8 Mon Sep 17 00:00:00 2001 From: "Alberto F. Martin" Date: Thu, 30 Apr 2026 09:49:53 +1000 Subject: [PATCH 2/4] Added PR # to NEWS.md --- NEWS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEWS.md b/NEWS.md index 64a1cb80c..f72c81df7 100644 --- a/NEWS.md +++ b/NEWS.md @@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] ### Added -- A couple of broken tests in DivConformingFESpacesTests.jl related to NormalSignMap facet cell owners default criterion. Since PR[#XXX](https://github.com/gridap/Gridap.jl/pull/XXX) +- A couple of broken tests in DivConformingFESpacesTests.jl related to NormalSignMap facet cell owners default criterion. Since PR[#1292](https://github.com/gridap/Gridap.jl/pull/1292) ## [0.20.5] - 2026-04-28 From 6b06b5c3bbcce5b8b6088cfa0de25eea6b93183d Mon Sep 17 00:00:00 2001 From: "Alberto F. Martin" Date: Thu, 30 Apr 2026 09:56:55 +1000 Subject: [PATCH 3/4] Do not use rand in the added broken tests, as suggested by CoPilot --- test/FESpacesTests/DivConformingFESpacesTests.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/FESpacesTests/DivConformingFESpacesTests.jl b/test/FESpacesTests/DivConformingFESpacesTests.jl index b85059056..2205a335d 100644 --- a/test/FESpacesTests/DivConformingFESpacesTests.jl +++ b/test/FESpacesTests/DivConformingFESpacesTests.jl @@ -306,7 +306,7 @@ end order = 0 reffe = ReferenceFE(raviart_thomas,Float64,order) V1 = TestFESpace(model,reffe) - uh1 = FEFunction(V1,rand(num_free_dofs(V1))) + uh1 = FEFunction(V1,ones(num_free_dofs(V1))) topo = get_grid_topology(model) facet_cells = get_faces(topo,1,2) From ba3cbd4e586b135960af9797563f423ac22e80ee Mon Sep 17 00:00:00 2001 From: "Alberto F. Martin" <38347633+amartinhuertas@users.noreply.github.com> Date: Thu, 30 Apr 2026 10:02:17 +1000 Subject: [PATCH 4/4] Update test/FESpacesTests/DivConformingFESpacesTests.jl Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- test/FESpacesTests/DivConformingFESpacesTests.jl | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/test/FESpacesTests/DivConformingFESpacesTests.jl b/test/FESpacesTests/DivConformingFESpacesTests.jl index 2205a335d..1500c9673 100644 --- a/test/FESpacesTests/DivConformingFESpacesTests.jl +++ b/test/FESpacesTests/DivConformingFESpacesTests.jl @@ -310,8 +310,17 @@ end topo = get_grid_topology(model) facet_cells = get_faces(topo,1,2) - facet_cells.data[4]=2 - facet_cells.data[5]=1 + 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) uh2 = FEFunction(V2,get_free_dof_values(uh1))