meshio: Wrong mesh total volume with MSH4 format
Hi,
I think there might be an error when reading Gmsh v4 format.
I have a box split as 6 horizontal boxes with different physical groups. A vertical box (a fault) cuts the 4 middle boxes. No issue whatsoever while meshing. I still check that everything is fine by calculating the total volume of my tetrahedra cells (it should equal 6e10 in my case).
With a mesh file exported as MSH4, I get a bigger volume. Nevertheless, the volume is correct when I export my mesh as MSH2. Both meshio.Mesh objects have the same number of tetra, but I noticed that the one for MSH2 has fewer points (5333 instead of 5337 for MSH4). I don’t know if it helps, though.
I attach an archive containing the Gmsh script (actually generated by pygmsh), the two Gmsh mesh files (v2 and v4) and a script to check the total volume of the mesh: mesh4.zip
Note that everything is alright if I do not define physical groups.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 24 (24 by maintainers)
Here you go: https://gitlab.onelab.info/gmsh/gmsh/issues/675
Update: the bug is known and is fixed in the development version.
Sorry, I reopen the issue because I think that I figured out what’s going on.
Gmsh 4.4.1 on Windows exports to MSH4 with one extra node compared to MSH2 (node 892):
Node 892 is the only node that is not in the correct order, it is not used in any element and does not exist in MSH2 file (basically, it is useless). Logically, it should not be used in any
tetracell in meshio. However, when I check whether anytetracell uses this node in meshio:Output:
But no cell uses node 890 while they should. If I remove node 892 from the MSH4 file (and edit the file accordingly), everything is alright.
It does not change the fact that Gmsh should not export this node in the first place, though.
mesh4_5.zip
Note:
I get an error reading
mesh4.mshfrommesh4_2.zipin Gmsh 4.5.0-git-0c1b63c8d on Ubuntu 19.04:How was this file generated? The first
mesh4.mshfrommesh4.zipwas O. K.