From 09b6e9b6fb8588d5087a87054f471ee14559ae3f Mon Sep 17 00:00:00 2001 From: "Alberto F. Martin" Date: Tue, 18 Jul 2023 15:45:01 +1000 Subject: [PATCH 1/2] Added a test to RefinementRulesTests.jl that fails and should not --- test/AdaptivityTests/RefinementRulesTests.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/test/AdaptivityTests/RefinementRulesTests.jl b/test/AdaptivityTests/RefinementRulesTests.jl index 278180265..3e4e84556 100644 --- a/test/AdaptivityTests/RefinementRulesTests.jl +++ b/test/AdaptivityTests/RefinementRulesTests.jl @@ -22,6 +22,9 @@ for poly in polys rr_red = Adaptivity.RedRefinementRule(poly) Adaptivity.test_refinement_rule(rr_red) + rrules=[rr_generic, rr_white, rr_red] + @test isconcretetype(eltype(rrules)) + n_edges = num_faces(poly,1) for e in 1:n_edges rr_green = Adaptivity.GreenRefinementRule(poly,e) From b86e3fbf284f50f4cd3d9fe9a1ea7ab278c30f4c Mon Sep 17 00:00:00 2001 From: "Alberto F. Martin" Date: Tue, 18 Jul 2023 16:22:10 +1000 Subject: [PATCH 2/2] Solves issue exposed by test added in 09b6e9b6fb8588d5087a87054f471ee14559ae3f for WhiteRefinementRule + QUADs. RedRefinementRule still problematic with QUADs --- src/Adaptivity/EdgeBasedRefinement.jl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Adaptivity/EdgeBasedRefinement.jl b/src/Adaptivity/EdgeBasedRefinement.jl index 7347a1356..83792c714 100644 --- a/src/Adaptivity/EdgeBasedRefinement.jl +++ b/src/Adaptivity/EdgeBasedRefinement.jl @@ -406,9 +406,10 @@ _has_interior_point(rr::RefinementRule,::RefinementRuleType) = false """ RefinementRule representing a non-refined cell. """ -function WhiteRefinementRule(p::Polytope) - ref_grid = UnstructuredDiscreteModel(UnstructuredGrid(LagrangianRefFE(Float64,p,1))) - return RefinementRule(WithoutRefinement(),p,ref_grid) +function WhiteRefinementRule(p::Polytope{D}) where {D} + partition = tfill(1,Val{D}()) + ref_grid = UnstructuredGrid(compute_reference_grid(p,partition)) + RefinementRule(WithoutRefinement(),p,ref_grid) end """