Files
JuliaFEM.jl/test/tutorials/01_fundamentals/reading_gmsh_meshes.msh
T
Jukka Aho b91e81c125 test: Add Tutorial 2 - Gmsh mesh reading (72 tests passing)
Educational tutorial covering complete Gmsh.jl workflow:
- Mesh generation recipe (2×5 structured Quad4 grid)
- Reading nodes and extracting coordinates
- Reading elements and topology
- Physical group extraction for boundary conditions
- Creating JuliaFEM Element objects from Gmsh data
- Geometry field validation

Features:
- Co-located .msh file (10 elements, 18 nodes) for self-contained testing
- Recipe script shows exactly how mesh was generated (reproducible)
- Comprehensive tests (72 assertions) validating entire workflow
- Runtime: ~3 seconds
- Type-safe conversions (UInt64 → Int64 for connectivity)

Tutorial series now: 77/77 tests passing (Tutorial 1: 5, Tutorial 2: 72)
2025-11-09 02:24:06 +02:00

104 lines
1.2 KiB
Plaintext

$MeshFormat
4.1 0 8
$EndMeshFormat
$PhysicalNames
5
1 2 "BOTTOM"
1 3 "RIGHT"
1 4 "TOP"
1 5 "LEFT"
2 1 "DOMAIN"
$EndPhysicalNames
$Entities
4 4 1 0
1 0 0 0 0
2 1 0 0 0
3 1 1 0 0
4 0 1 0 0
1 0 0 0 1 0 0 1 2 2 1 -2
2 1 0 0 1 1 0 1 3 2 2 -3
3 0 1 0 1 1 0 1 4 2 3 -4
4 0 0 0 0 1 0 1 5 2 4 -1
1 0 0 0 1 1 0 1 1 4 1 2 3 4
$EndEntities
$Nodes
9 18 1 18
0 1 0 1
1
0 0 0
0 2 0 1
2
1 0 0
0 3 0 1
3
1 1 0
0 4 0 1
4
0 1 0
1 1 0 1
5
0.4999999999986921 0 0
1 2 0 4
6
7
8
9
1 0.1999999999995569 0
1 0.3999999999989731 0
1 0.599999999998945 0
1 0.7999999999994725 0
1 3 0 1
10
0.5000000000020595 1 0
1 4 0 4
11
12
13
14
0 0.8 0
0 0.6000000000013874 0
0 0.400000000001665 0
0 0.2000000000008325 0
2 1 0 4
15
16
17
18
0.4999999999993655 0.2000000000001947 0
0.500000000000039 0.4000000000003191 0
0.5000000000007124 0.6000000000001661 0
0.5000000000013859 0.7999999999997363 0
$EndNodes
$Elements
5 24 1 24
1 1 1 2
1 1 5
2 5 2
1 2 1 5
3 2 6
4 6 7
5 7 8
6 8 9
7 9 3
1 3 1 2
8 3 10
9 10 4
1 4 1 5
10 4 11
11 11 12
12 12 13
13 13 14
14 14 1
2 1 3 10
15 1 5 15 14
16 14 15 16 13
17 13 16 17 12
18 12 17 18 11
19 11 18 10 4
20 5 2 6 15
21 15 6 7 16
22 16 7 8 17
23 17 8 9 18
24 18 9 3 10
$EndElements