From 1663e6d59b016978c05631f1c92f03e8062ad887 Mon Sep 17 00:00:00 2001 From: Jukka Aho Date: Mon, 15 Dec 2025 06:38:41 +0200 Subject: [PATCH] test(quadrature): add legacy API test Test file included in test/quadrature/runtests.jl Tests backward compatibility with legacy quadrature API --- test/quadrature/test_legacy_api.jl | 74 ++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 test/quadrature/test_legacy_api.jl diff --git a/test/quadrature/test_legacy_api.jl b/test/quadrature/test_legacy_api.jl new file mode 100644 index 0000000..f6c4e23 --- /dev/null +++ b/test/quadrature/test_legacy_api.jl @@ -0,0 +1,74 @@ +# This file is a part of JuliaFEM. +# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md + +@testset "Legacy API Compatibility" begin + + @testset "Triangle legacy symbols" begin + # Test that old Val{:GLTRI*} symbols still work + @test get_quadrature_points(Val{:GLTRI1}) !== nothing + @test get_quadrature_points(Val{:GLTRI3}) !== nothing + @test get_quadrature_points(Val{:GLTRI3B}) !== nothing + @test get_quadrature_points(Val{:GLTRI4}) !== nothing + @test get_quadrature_points(Val{:GLTRI4B}) !== nothing + @test get_quadrature_points(Val{:GLTRI6}) !== nothing + @test get_quadrature_points(Val{:GLTRI7}) !== nothing + @test get_quadrature_points(Val{:GLTRI12}) !== nothing + + # Test order queries + @test get_order(Val{:GLTRI1}) == 1 + @test get_order(Val{:GLTRI3}) == 2 + @test get_order(Val{:GLTRI4}) == 3 + end + + @testset "Tetrahedron legacy symbols" begin + @test get_quadrature_points(Val{:GLTET1}) !== nothing + @test get_quadrature_points(Val{:GLTET4}) !== nothing + @test get_quadrature_points(Val{:GLTET5}) !== nothing + @test get_quadrature_points(Val{:GLTET15}) !== nothing + + @test get_order(Val{:GLTET1}) == 1 + @test get_order(Val{:GLTET4}) == 2 + @test get_order(Val{:GLTET5}) == 3 + @test get_order(Val{:GLTET15}) == 4 + end + + @testset "Wedge legacy symbols" begin + @test get_quadrature_points(Val{:GLWED6}) !== nothing + @test get_quadrature_points(Val{:GLWED6B}) !== nothing + @test get_quadrature_points(Val{:GLWED21}) !== nothing + + @test get_order(Val{:GLWED6}) == 1 + @test get_order(Val{:GLWED6B}) == 1 + @test get_order(Val{:GLWED21}) == 5 + end + + @testset "Pyramid legacy symbols" begin + @test get_quadrature_points(Val{:GLPYR5}) !== nothing + @test get_quadrature_points(Val{:GLPYR5B}) !== nothing + + @test get_order(Val{:GLPYR5}) == 1 + @test get_order(Val{:GLPYR5B}) == 1 + end + + @testset "Tensor product legacy symbols" begin + # Segments + @test get_quadrature_points(Val{:GLSEG1}) !== nothing + @test get_quadrature_points(Val{:GLSEG2}) !== nothing + @test get_order(Val{:GLSEG1}) == 1 + @test get_order(Val{:GLSEG2}) == 3 + + # Quadrilaterals + @test get_quadrature_points(Val{:GLQUAD1}) !== nothing + @test get_quadrature_points(Val{:GLQUAD4}) !== nothing + @test get_quadrature_points(Val{:GLQUAD9}) !== nothing + @test get_order(Val{:GLQUAD1}) == 1 + @test get_order(Val{:GLQUAD4}) == 3 + + # Hexahedra + @test get_quadrature_points(Val{:GLHEX1}) !== nothing + @test get_quadrature_points(Val{:GLHEX8}) !== nothing + @test get_quadrature_points(Val{:GLHEX27}) !== nothing + @test get_order(Val{:GLHEX1}) == 1 + @test get_order(Val{:GLHEX8}) == 3 + end +end