From dcaa563fc480e756f50397f741f236eb9c1e8cd3 Mon Sep 17 00:00:00 2001 From: Jesse Chan <1156048+jlchan@users.noreply.github.com> Date: Fri, 28 Jun 2024 15:51:47 -0500 Subject: [PATCH] Fix `N=1` Pyr initializatoin (#174) * adjust tolerance * add tests --- src/connectivity_functions.jl | 2 +- test/MeshData_wedge_pyr_tests.jl | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/connectivity_functions.jl b/src/connectivity_functions.jl index aa845354..28e36ce1 100644 --- a/src/connectivity_functions.jl +++ b/src/connectivity_functions.jl @@ -112,7 +112,7 @@ build_node_maps(rd::RefElemData{3, <:Union{Tet, Hex}}, FToF, Xf; kwargs...) = # in rd.element_type.node_ids_by_face. # !!! note: this version infers `num_elements` from the dimensions of `FToF::Matrix`. # !!! this will not work for adaptive meshes, where `FToF` will be a `Vector`. -function build_node_maps(rd::RefElemData{3, <:Union{Wedge, Pyr}}, FToF, Xf; tol = 100 * eps()) +function build_node_maps(rd::RefElemData{3, <:Union{Wedge, Pyr}}, FToF, Xf; tol = 1e3 * eps()) _, num_elements = size(FToF) (; element_type) = rd diff --git a/test/MeshData_wedge_pyr_tests.jl b/test/MeshData_wedge_pyr_tests.jl index e3a139c6..731a8124 100644 --- a/test/MeshData_wedge_pyr_tests.jl +++ b/test/MeshData_wedge_pyr_tests.jl @@ -2,6 +2,14 @@ approx_elem_types_to_test = [(Polynomial(), Wedge()), (Polynomial(), Pyr())] @testset "3D MeshData tests for wedges and pyramids" begin + + # tests initialization (mostly checking if tolerances) + @testset "Initialization test for $element_type" for (element_type, N) in [(Pyr(), 1), (Pyr(), 4), (Wedge(), 1), (Wedge(), 4)] + K1D = 2 + rd = RefElemData(element_type, N) + md = MeshData(uniform_mesh(element_type, K1D)..., rd; is_periodic=true) + end + @testset "$approximation_type $element_type MeshData initialization" for (approximation_type, element_type) in approx_elem_types_to_test tol = 5e2*eps()