JuliaVTK / WriteVTK.jl

Julia package for writing VTK XML files
Other
151 stars 32 forks source link

Add function for loading an existing pvd file #53

Closed sebastianpech closed 5 years ago

sebastianpech commented 5 years ago

Adds paraview_collection_load that loads an existing pvd file. This allows appending new vtk files to the collection.

As mentioned in the comment, loading added some empty text nodes which messed up the formatting. Not a big deal but this way the file looks cleaner and structurally matches the original file.

Some points for discussion:

  1. paraview_collection_load could be the default behavior for paraview_collection if the pvd already exists . However this contradicts vtk file saving/creating. I think it's better to leave that to the user.
  2. On vtk_save(pvd) now only the newly added VTK files are returned. I don't know what the motivation was for returning all files. I could push the old files during loading so all files are returned if this is better.
jipolanco commented 5 years ago

That's great, thanks.

I agree with your two points. First, paraview_collection should be consistent with vtk_grid in that it deletes existent files. As for the second point, the motivation was to know which files are generated when you do a vtk_save. It's probably not that useful, but it's convenient for tests :)