Understanding the VTK format in Paraview

Not completely what was asked, but when generating VTK files (legacy and XML) we often generate an additional TimeValue as a FieldData. Since it is field-data, it only adds a few bytes to the file.
The choice of the field name comes from what Catalyst uses. Can extract and display in ParaView.

For human documentation, we sometimes add in an additional XML comment:

<!-- time='...' index='...' -->

This lets you scrape the file header and extract values. Eg, with a shell script to assemble other content.

For associating a series of files (legacy or xml) with time values, the JSON series file is extremenly convenient.
For example,

{
    "file-series-version" : "1.0",
    "files": [
      { "name" : "file1.vtk", "time" : 10 },
      { "name" : "file2.vtk", "time" : 20 },
      { "name" : "file3.vtk", "time" : 30 },
    ]
}

The only minor drawback with the series file is that it probably still does not support a sub-directory structure for its names.

1 Like