From 48e1874dff97d1707b393b92c24ebdf8a141c63b Mon Sep 17 00:00:00 2001 From: Jukka Aho Date: Mon, 15 Dec 2025 06:32:28 +0200 Subject: [PATCH] test(basis): add test_svector_returns test Test file included in test/basis/runtests.jl --- test/basis/test_svector_returns.jl | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 test/basis/test_svector_returns.jl diff --git a/test/basis/test_svector_returns.jl b/test/basis/test_svector_returns.jl new file mode 100644 index 0000000..0cbfdb9 --- /dev/null +++ b/test/basis/test_svector_returns.jl @@ -0,0 +1,26 @@ +# Test that basis functions return SVector types +using Test +using StaticArrays, Tensors + +include("../../src/topology/api.jl") +include("../../src/topology/segments.jl") +include("../../src/topology/triangles.jl") +include("../../src/topology/quadrilaterals.jl") +include("../../src/topology/tetrahedra.jl") +include("../../src/topology/hexahedra.jl") +include("../../src/topology/pyramids.jl") +include("../../src/topology/wedges.jl") +include("../../src/basis/api.jl") +include("../../src/basis/basis_generated.jl") + +@testset "SVector Return Types" begin + @testset "Basis functions" begin + N = get_basis_functions(Tri3(), Lagrange{1}(), Vec{2}((0.5, 0.25))) + @test N isa SVector{3,Float64} + end + + @testset "Derivatives" begin + dN = get_basis_derivatives(Tri3(), Lagrange{1}(), Vec{2}((0.5, 0.25))) + @test dN isa SVector{3,Vec{2,Float64}} + end +end