Skip to content

Commit

Permalink
Fix N=1 Pyr initializatoin (#174)
Browse files Browse the repository at this point in the history
* adjust tolerance

* add tests
  • Loading branch information
jlchan authored Jun 28, 2024
1 parent 8f009ae commit dcaa563
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/connectivity_functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions test/MeshData_wedge_pyr_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit dcaa563

Please sign in to comment.