Open cweickhmann opened 3 years ago
Looks like part 1 of my problem is related to #427.
There have been some label fixes lately, perhaps this is fixed now.
I still have this problem with pygmsh v7.1.17
extract_to_meshio() messes up the indices of physicals.
mwe-files.zip Hi, here's a MWE for a problem generating and converting geometry/mesh using
pygmsh
andmeshio
. It is two problems really:pygmsh.write
being empty (gmsh format version 4.1) or wrong (gmsh format version 2.2)What I am trying to do
I try to generate a geometry using
pygmsh
programatically, generate a mesh in a gmsh format (either 2.2 or 4.1) and try to convert it to XDMF usingmeshio
.Generate the geometry
Running Variant 1, I obtain a msh file with the following output:
Running Variant 2, I get a WriteError:
Using Variant 3, I obtain a geo file which I can run through
gmsh
on the command line:or
Finally I convert
meshio
using the following function (courtesy dokken):What happens
Variant 1 /
gmsh_mwe.pygmsh.22.msh
Converting the binary gmsh file to XDMF produces a mesh where the cell markers show values of 1e-38. Looks like a type conversion problem to me.
Variant 2 /
gmsh_mwe.pygmsh.41.msh
Fails upon creation of the msh file with a WriteError (see above). The msh file is thus almost empty.
Variant 3a (gmsh 2.2 format via the terminal)
Successfully produces XDMF files with desired cell tags (screenshot below).
Variant 3b (gmsh 4.1 format via the terminal)
Produces cell tags with the correct value range, but all jumbled up (see screenshot, note the boundary mesh is offset to make the jumbling more easily visible - coordinates are fine!).
Versions
Machine/OS
Architecture x86_64
Windows 10 20H2 with a Ubuntu 20.04 in a WSL 1 (but reproduces same results on a pure Ubuntu 20.04 x86_64)
Python Version 3.8.5
This was tested using the following packages:
Attachments
mwe-files.zip