version is double and specified in Gmsh 4.1.5 as literally 4.0
@@ -265,7 +265,7 @@ def write(filename, mesh, write_binary=True):
mode_idx = 1 if write_binary else 0
size_of_double = 8
fh.write(
- ("$MeshFormat\n4 {} {}\n".format(mode_idx, size_of_double)).encode("utf-8")
+ ("$MeshFormat\n4.0 {} {}\n".format(mode_idx, size_of_double)).encode("utf-8")
)
if write_binary:
fh.write(struct.pack("i", 1))
