I am facing a quite unexpected behaviour when converting meshes from gmsh's msh file format using Elmergrid. I am using ElmerGrid as follows:
Code: Select all
ElmerGrid.exe 14 2 my_mesh.msh -out [path to my data folder]
I am currently setting up a simulation pipeline where I build parametric meshes in GMSH and solve them in Elmer. Thus, I have to run mesh generation - ElmerGrid conversion - ElmerSolver hundreds of times. In more than 99% of cases, above conversion works flawlessly. But every hundred-and-so cases, it fails giving the following error message:
Code: Select all
Elmergrid loading data:
-----------------------
Format chosen using the first line: $MeshFormat
Gmsh version is 4.1
Loading mesh in Gmsh format 4.1 from file my_mesh.msh
Reading 485 entities in 0D
Reading 989 entities in 1D
Reading 594 entities in 2D
Reading 1 entities in 3D
Entity line 1 has length 3615.
$Entities section should end to string $EndEntities:
$Nodes
The program encountered a major error...
No nodes to load in Gmsh file!
...now exiting to system...
Code: Select all
$EndEntities
Code: Select all
$Entities
485 989 594 1
...
[shortened for readability]
...
594 -118.0897519161978 83.67989938860785 51.62813872604876 -117.2223149013572 84.88132485396667 52.40084486291649 1 14 1 100000988
1 -132.2982841579826 81.40252336735487 26.04584897934522 -92.29827415798256 86.48892438835442 66.04585897934523 1 12 594 1 -2 3 4 5 6 [shortened for readability] 593 594
$EndEntities
$Nodes
1655 6701 1 6701
0 200002 0 1
1
-112.0317137726694 83.50117900126195 45.74750382841989
0 200003 0 1
Code: Select all
$EndEntities
Code: Select all
$Entities section should end to string $EndEntities:
Code: Select all
Elmergrid loading data:
-----------------------
Format chosen using the first line: $MeshFormat
Gmsh version is 4.1
Loading mesh in Gmsh format 4.1 from file my_mesh.msh
Reading 485 entities in 0D
Reading 989 entities in 1D
Reading 594 entities in 2D
Reading 1 entities in 3D
Entity line 1 has length 3615.
$Entities section should end to string $EndEntities:
Allocating for 6701 knots and 33335 elements.
Boundary name for physical group 12 is: Phys A
Boundary name for physical group 13 is: Phys B
Boundary name for physical group 14 is: Other Surfaces
Body name for physical group 12 is: Main Volume
Allocating lookup table for tags of size 100000988
Maximum original tag for 989 1DIM entities is 100000988
Maximum original tag for 594 2DIM entities is 594
Maximum original tag for 1 3DIM entities is 1
$Entities section should end to string $EndEntities:
Untreated command:
Reading 6701 nodes in 1655 blocks.
Reading 33335 elements in 595 blocks.
Reading 5 elements with tag 1 of type 303
Mapping mesh tag 1 to physical tag 14 in 2DIM
Reading 32 elements with tag 2 of type 303
Mapping mesh tag 2 to physical tag 14 in 2DIM
Reading 5 elements with tag 3 of type 303
Mapping mesh tag 3 to physical tag 14 in 2DIM
I inspected the meshing result of GMSH before exporting it into msh format and cannot see any difference to meshes that can be successfully converted with ElmerGrid.
Any help/hints on this would be greatly appreciated!