vth files not working correctly with TimeArray
We have a set of vth files written by the Pagosa adaptor. The files have field data containing TimeValue, Cycle Number, and Simulation Time. When using the nightly build of Paraview, which has the feature of being able to choose the Time Array, choosing Simulation Time for the Time Array creates problems, and breaks things.
Note that we also have a set of vtm files, but there doesn't seem to be any issues with the vtm files, just vth files.
Example dataset: insitu.zip
How to reproduce:
- Use a nightly build of Paraview
- Choose the .vth files as a file series
- The Time Array is automatically set to TimeValue, hit Apply to load
- Note that there are 7 timesteps loaded
- Change Time Array to Simulation Time, hit Apply
- If you check the "Time" dropbox, the values haven't been updated
- Step forward through a timestep
- Change the Time Array back to TimeValue, hit Apply
- Now Paraview says there are only two timesteps loaded
Pat has investigated this and gave an explanation of what is going on:
XMLMultiBlockReader is a XMLCompositeDataSetReader is a XMLReader XMLUniformGridAMRReader is a XMLCompositeDataSetReader is a XMLReader
When I change from TimeValue to CycleNumber with the .vtm, Modified() is set to true and RequestInformation is called (on MultiBlock, then Composite, and finally XMLReader). That causes the ActiveTimeArray to be set to CycleNumber and causes each of the seven .vtm files to be read. The data value corresponding to CycleNumber is pulled out of the FieldData and stored so that TIME_STEPS can be set. Then it goes back to the first file and loads the data via RequestData.
When we change TimeValue to CycleNumber with the .vth, Modified() is set to true, but some extra stuff is called first. This includes RequestDataObject(), ReadVTKFile() and ReadPrimaryElement(). This last one calls XMLReader::ReadPrimaryElement which calls XMLReader::ReadXMLInformation which is where the CycleNumber is fetched.
Then the regular RequestInformation sequence is called on UniformGridAMRReader, CompositeReader and XMLReader. The problem is that when XMLReader::ReadXMLInformation() was called the first time, it changed Modified() to false. So when it is called this time, and should read all the .vth and pull out the CycleNumber, that part does not execute, because it thinks there is no change.
I was able to test this by removing the Modified() reset and was able to get it to work, but of course other stuff would be wrong.
I think there is a problem in vtkXMLUniformGridAMRReader in that it should not be reading the FieldData and allowing the Modified flag to be reset prematurely.