From f9d17c22e87ef7f911571f883f43e8c8fe620cd8 Mon Sep 17 00:00:00 2001 From: Jukka Aho Date: Mon, 15 Dec 2025 06:39:46 +0200 Subject: [PATCH] test(topology): add entity dimensions test Test file included in main test/runtests.jl Tests topological entity dimension properties --- test/topology/test_entity_dimensions.jl | 26 +++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 test/topology/test_entity_dimensions.jl diff --git a/test/topology/test_entity_dimensions.jl b/test/topology/test_entity_dimensions.jl new file mode 100644 index 0000000..e998598 --- /dev/null +++ b/test/topology/test_entity_dimensions.jl @@ -0,0 +1,26 @@ +# This file is a part of JuliaFEM. +# License is MIT: see https://github.com/JuliaFEM/JuliaFEM.jl/blob/master/LICENSE.md + +using JuliaFEM +using Test + +@testset "Entity Dimensions" begin + # 1D elements + @test dim(Segment{2}()) == 1 + @test dim(Segment{3}()) == 1 + + # 2D elements + @test dim(Triangle{3}()) == 2 + @test dim(Triangle{6}()) == 2 + @test dim(Quadrilateral{4}()) == 2 + @test dim(Quadrilateral{9}()) == 2 + + # 3D elements + @test dim(Tetrahedron{4}()) == 3 + @test dim(Tetrahedron{10}()) == 3 + @test dim(Hexahedron{8}()) == 3 + @test dim(Hexahedron{27}()) == 3 + @test dim(Pyramid{5}()) == 3 + @test dim(Wedge{6}()) == 3 + @test dim(Wedge{15}()) == 3 +end