So far I’ve been using .xml files to read in meshes. Workflow was as follows:
convert .geo to .msh using
gmsh -3 spheres.geo -format msh2
,
running
dolfin-convert spheres.msh spheres.xml
,
read in via
mesh = Mesh('spheres.xml')
.
Now I’d like to use a much larger mesh, which, when run using
mpirun -n 12 python test.py
gives me a warning
Process 0: *** Warning: XML file 'te.xml' is very large. XML files are parsed in serial, which is not scalable. Use XMDF/HDF5 for scalable IO in parallel
and takes forever.
Looking around here, and from the error message, I see that I somehow need to create an XMDF/HDF5 file. Specifically, I’ve looked at this post. However, if I follow dokken’s answer, I get an error in
meshio.write("mesh.xdmf", meshio.Mesh(points=msh.points, cells={"tetra": msh.cells["tetra"]}))
list indices must be integers or slices, not str
Using msh.cells[2][1] instead of “tetra” works, but I get a similar error in the next line, which I can’t resolve:
TypeError: The first input argument needs to be a sequence
Bonus question: are there any docs/examples for this type of problem? Surely this is very common?