Hey there,
I’ve created a mesh with the gmsh api. When I’m trying to convert the .msh to .xml (with dolfin-convert and meshio) or .xmdf with meshio, then I get the following errors:
dolfin-convert error:
ValueError: invalid literal for int() with base 10: '112 55296\n'
meshio error:
AssertionError: Need mesh format 2
Those errors only appear if I use the API, maybe some gmsh users know this problem?
My script for generating the mesh with gmsh is the following:
import gmsh
gmsh.initialize()
gmsh.open("porous_structure_gmsh.geo")
entities = gmsh.model.getEntities(3)
entities2 = gmsh.model.getEntities(2)
domainId = [entity[1] for entity in entities]
noslipId = [entity[1] for entity in entities2 if gmsh.model.getType(entity[0], entity[1]) == 'Sphere']
# Nodes = gmsh.model.mesh.getNodes(-1,-1,True)
# Elements = gmsh.model.mesh.getElements(3,-1)
gmsh.model.addPhysicalGroup(3, domainId,0)
gmsh.model.addPhysicalGroup(2, noslipId, 1)
gmsh.model.setPhysicalName(3,0,"0")
gmsh.model.setPhysicalName(2,1,"NoSlipBoundary")
gmsh.model.mesh.generate(3)
gmsh.model.mesh.refine()
gmsh.model.mesh.refine()
gmsh.write("test.msh")
gmsh.finalize()
If I open the .msh in gmsh everything seems right, even the physical groups work perfectly
Here are all necessary files to reproduce the error (geo file, gmsh meshing script as above and of course the mesh which I’m not able to convert)
Thanks in advance and kind regards
Max