test(io): add Gmsh ASCII reader regression

This commit is contained in:
Jukka Aho
2026-05-09 18:38:59 +03:00
parent a5d2b411d3
commit 9f76c432c6
+21
View File
@@ -0,0 +1,21 @@
# SPDX-FileCopyrightText: 2015-2026 Jukka Aho
# SPDX-License-Identifier: MIT
using Test
using JuliaFEM.GmshReader: read_gmsh_mesh, get_surface_nodes
@testset "GmshReader Tet4 (ASCII 4.1)" begin
path = joinpath(@__DIR__, "..", "testdata", "cantilever_beam.msh")
gm = read_gmsh_mesh(path)
@test size(gm.nodes, 1) == 3
@test size(gm.elements, 1) == 4
@test size(gm.nodes, 2) 1
@test size(gm.elements, 2) 1
@test haskey(gm.physical_groups, "Bulk")
fix = get_surface_nodes(gm, "FixedEnd")
top = get_surface_nodes(gm, "PressureSurface")
@test !isempty(fix)
@test !isempty(top)
@test isempty(get_surface_nodes(gm, "UnknownBoundary"))
end