[vtkusers] writing time-dependent data

Rustem Khabetdinov rustem.khabetdinov at gmail.com
Wed Mar 22 07:56:58 EDT 2017


Hello,

I know it is late but this might help you. The way I do it using python:

import vtk
> data_to_write = vtk.vtkUnstructuredGrid()
> writer = vtk.vtkXMLUnstructuredGridWriter()
> number_of_steps = 5
> writer.SetNumberOfTimeSteps(number_of_steps)
> writer.SetInputData(data_to_write)
> writer.SetFileName('path/to/file')
> writer.Start()
> for i in range(number_of_steps):
>   data_to_write.ShallowCopy(some_input_data)
>   writer.WriteNextTime(i)
> writer.Stop()


Hope this helps anyone


2017-02-17 18:42 GMT+03:00 Bill Greene <w.h.greene at gmail.com>:

> I have been trying to write time-dependent data to
> an XML file using vtkXMLUnstructuredGridWriter.
>
> I found an example,
> http://www.vtk.org/Wiki/VTK/Examples/Cxx/Broken/IO/ExodusIIWriter,
> that uses vtkTimeSourceExample to write time-dependent data to
> an Exodus II file. Despite the word "Broken" in the URL, this appears
> to work correctly. But when I modify it to use
> vtkXMLUnstructuredGridWriter instead of vtkExodusIIWriter, only the
> model data is written.
>
> Can someone tell me if vtkXMLUnstructuredGridWriter is supposed
> to handle time-dependent data, or if not,
> how to write an XML file with time-dependent data?
>
> I am using vtk 7.1.0.
>
> Thanks,
>
> Bill Greene
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/
> opensource/opensource.html
>
> Please keep messages on-topic and check the VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Search the list archives at: http://markmail.org/search/?q=vtkusers
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170322/6f805825/attachment.html>


More information about the vtkusers mailing list