Dear all,<br><br>just for sharing, a method of how to store multiple time-steps in a<br>single .vt?-file (haven't found this yet, only statements that this is<br>either impossible or directions to use the EnSight format). I tested<br>
this with the XML Polydata and Unstructured Grid writers from vtk 5.8<br>and the current 6.0 snapshot.<br><br>I have a series of vtk-files containing 1 time-step<br>each (N.B. from the CGNS-export of a proprietary CFD software<br>
package). The python-script for Unstructured Grid Data:<br><br>> #!/usr/bin/env python<br>> <br>> from vtk import vtkXMLUnstructuredGridReader,vtkXMLUnstructuredGridWriter<br>> from glob import glob<br>><br>
> dt = delta_t<br>> <br>> reader = vtkXMLUnstructuredGridReader()<br>> filelist = sorted(glob('path/to/file/series-????.vtu'))<br>> # the '?' stands for a single character, numbers in my case<br>
> <br>> writer = vtkXMLUnstructuredGridWriter()<br>> writer.SetFileName('outfile.vtu')<br>> writer.SetNumberOfTimeSteps(len(filelist))<br>> writer.SetTimeStepRange(0,len(filelist)-1)<br>> writer.SetInputConnection(reader.GetOutputPort())<br>
> <br>> writer.Start()<br>> <br>> for file,i in zip(filelist,range(len(filelist))):<br>> print(file)<br>> reader.SetFileName(file)<br>> reader.Modified()<br>> writer.WriteNextTime(i*dt)<br>
> <br>> writer.Stop()<br><br>Static information like cell connectivity seems to be written<br>just once. When reading the file in paraview only memory for one<br>time-step is consumed (this doesn't seem to be the case for<br>
polydata, however). For no apparent reason Paraview fails to<br>display the correct time-values.<br><br>I hope that this will be useful.<br><br>Kind regards,<br>Johannes Strecha.<br>