evalf / nutils

The nutils project
http://www.nutils.org/
MIT License
88 stars 48 forks source link

Reading VTK exports with meshio #782

Closed meyer-nils closed 1 year ago

meyer-nils commented 1 year ago

Hi,

if I export a result using export.vtk(), reading that VTK file with meshio results in a ReadError. The reason for this is that meshio expects a binary newline b"\n" after each binary data block in the VTK file.

This could be easily prevented by adding vtk.write(b"\n") after each .tofile(vtk) in the function def vtk(name, cells, points, kwargs=...) in nutils.export. I could prepare a pull request to resolve this, if you agree.

Best regards Nils

gertjanvanzwieten commented 1 year ago

Hi @meyer-nils, sorry for the late follow-up! This sounds like a very reasonable fix so by all means send a PR so we can merge it in.