[vtkusers] Possible Bug in vtkXMLReader when reading timeseries

Simon Praetorius Simon.Praetorius at tu-dresden.de
Tue Sep 27 03:49:04 EDT 2016


Thanks for the work on this issue!
The merge request seems to solve the problem. My first test was the  
file `cube.vtu` generated by `IO/XML/Testing/Cxx/TestXMLCInterface.c`  
in the VTK source. It contains 8 timesteps of data with a fixed very  
simple mesh. It was previously not possible to read this file back  
again by a standard VtkXMLReader. Now this works fine without errors.  
Maybe this file can be used for a real test implementation.
I have also tested a private much larger data-set, also in combination  
with a ParaView, compiled using the modified VTK, and it works as well.

-> Instead of having a collection of .vtu files and a corresponding  
.pvd file, timeseries can now be stored again as a single .vtu file.
-> This allows to store the mesh only once (if it does not change) and  
just modify the data fields in each timestep

So, very nice! Thanks!
Simon


Zitat von Cory Quammen <cory.quammen at kitware.com>:

> One more thing, Simon. Could you contribute a small data set with more than
> one time step so that we can add a test that uses it?
>
> Thanks,
> Cory
>
> On Mon, Sep 26, 2016 at 10:39 AM, Cory Quammen <cory.quammen at kitware.com>
> wrote:
>
>> Simon,
>>
>> Might you be able to try TJ's merge request and see if it restores the
>> functionality you expected?
>>
>> Thanks,
>> Cory
>>
>> On Mon, Sep 26, 2016 at 9:34 AM, T.J. Corona <tj.corona at kitware.com>
>> wrote:
>>
>>> Hi Simon,
>>>
>>> I have created a MR (https://gitlab.kitware.com/vt
>>> k/vtk/merge_requests/2007) that reverts the addition of an
>>> exit-with-error when data arrays have the same name.
>>>
>>> Cory,
>>>
>>> I believe this MR also accounts for the segfault you originally reported
>>> when reading in data arrays that have duplicate names.
>>>
>>> Sincerely,
>>> T.J.
>>>
>>> Thomas J. Corona, Ph.D.
>>> Kitware, Inc.
>>> R&D Engineer
>>> 21 Corporate Drive
>>> Clifton Park, NY 12065-8662
>>> Phone: 518-881-4443
>>>
>>> On Sep 23, 2016, at 1:41 PM, Cory Quammen <cory.quammen at kitware.com>
>>> wrote:
>>>
>>> Simon,
>>>
>>> Thanks for your sleuthing and bug report. I don't believe your use case
>>> was known when merge request !488 was merged.
>>>
>>> TJ,
>>>
>>> Can you have a look at Simon's issue?
>>>
>>> Thanks,
>>> Cory
>>>
>>> On Fri, Sep 23, 2016 at 12:07 PM, Simon Praetorius <
>>> Simon.Praetorius at tu-dresden.de> wrote:
>>>
>>>> I have found an old issue in the mantis bug-tracker addressing this
>>>> topic: #15723
>>>>
>>>> The answer was: "VTK file format does not support saving several time
>>>> steps in a file" and a reference to the file-format description was given.
>>>> This description (version 4.2.) is definitely not complete, thus  
>>>> it can not
>>>> be an indicator for a support of writing timeseries or not.
>>>>
>>>> Although the file-format description does not show support for
>>>> timeseries, at least in older vtk versions (before 6.3) it was supported.
>>>> The source code of the XMLreader shows all the necessary parts to read the
>>>> time-series, all the corresponding attributes are interpreted. The only
>>>> problem is a change in the handling of duplicate names. This was  
>>>> done about
>>>> a year ago in merge request !488. Since there is no test that reads back
>>>> the files generated by `IO/XML/Testing/Cxx/TestXMLCInterface.c` no
>>>> error could be detected. The corresponding test to create the file was
>>>> removed in June 2016.
>>>>
>>>> Thus, the questions are:
>>>> - Is this feature quietly removed from VTK, or removed by accident since
>>>> only few people use it?
>>>> - Is the documentation of the file-format incomplete or the
>>>> implementation simply not cleaned up?
>>>> - Should the test for duplicate array names be rewritten in order to
>>>> allow timeseries again?
>>>> - There should be at least a comment in the file-format description that
>>>> duplicate array names are not allowed!
>>>>
>>>> Maybe this issue could be forwarded to the developer mailing list.
>>>>
>>>> Simon
>>>>
>>>>
>>>> Zitat von Simon Praetorius <Simon.Praetorius at tu-dresden.de>:
>>>>
>>>>
>>>> Hi,
>>>>>
>>>>> When reading a VTK XML-file that includes timesteps, the
>>>>> `vtkXMLDataReader:282` throws an error that multiple arrays with the same
>>>>> name are present in the file. In general this is a valid test  
>>>>> and the error
>>>>> is correct, except for the case that multiple timesteps are  
>>>>> written in the
>>>>> file. An example file can be created by the test
>>>>> `IO/XML/Testing/Cxx/TestXMLCInterface.c`:
>>>>>
>>>>> ```xml
>>>>> <Piece NumberOfPoints="8" NumberOfCells="1">
>>>>>   <PointData Scalars="example data">
>>>>>     <DataArray type="Float32" Name="example data" TimeStep="0"
>>>>> format="appended" RangeMin="0" RangeMax="0" offset="0" />
>>>>>     <DataArray type="Float32" Name="example data" TimeStep="1"
>>>>> format="appended" RangeMin="1" RangeMax="1" offset="240" />
>>>>>     <!-- ... -->
>>>>>   </PointData>
>>>>> </Piece>
>>>>> ```
>>>>> Here all DataArrays refer to the same dataset at different timesteps.
>>>>>
>>>>> Reading back this file, using a `VTLXMLUnstructuredGridReader` (e.g.
>>>>> `Examples/IO/Cxx/DumpXMLFile.cxx`), produced the error above:
>>>>>
>>>>> ```
>>>>> vtkXMLDataReader.cxx, line 282: Duplicate array names.
>>>>> ```
>>>>>
>>>>> Writing TimeSteps seems to be supported by the XMLReader and the
>>>>> XMLWriter. Maybe the `vtkXMLWriterC` is not valid/compatible any more? Is
>>>>> the structure of the vtk format changed when writing timeseries, compared
>>>>> to the xml-code shown above?
>>>>> (I'm referring to the VTK version 7.0.0, when naming line-numbers.)
>>>>>
>>>>>
>>>>> This issue refers to an old ParaView issue #5542 (
>>>>> http://www.paraview.org/Bug/view.php?id=5542). The file was readable
>>>>> with at least vtk-5.2 and paraview-3.6.2.
>>>>>
>>>>> Simon
>>>>>
>>>>> --
>>>>> Dr. Simon Praetorius
>>>>> Institut für Wissenschaftliches Rechnen
>>>>> Fachrichtung Mathematik
>>>>> Technische Universität Dresden
>>>>> Tel.: TUD-42377
>>>>> Mail: simon.praetorius at tu-dresden.de
>>>>> Web: www.math.tu-dresden.de/~spraetor
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Dr. Simon Praetorius
>>>> Institut für Wissenschaftliches Rechnen
>>>> Fachrichtung Mathematik
>>>> Technische Universität Dresden
>>>> Tel.: TUD-42377
>>>> Mail: simon.praetorius at tu-dresden.de
>>>> Web: www.math.tu-dresden.de/~spraetor
>>>>
>>>> _______________________________________________
>>>> 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
>>>>
>>>>
>>>
>>>
>>> --
>>> Cory Quammen
>>> Staff R&D Engineer
>>> Kitware, Inc.
>>>
>>>
>>>
>>
>>
>> --
>> Cory Quammen
>> Staff R&D Engineer
>> Kitware, Inc.
>>
>
>
>
> --
> Cory Quammen
> Staff R&D Engineer
> Kitware, Inc.



-- 
Dr. Simon Praetorius
Institut für Wissenschaftliches Rechnen
Fachrichtung Mathematik
Technische Universität Dresden
Tel.: TUD-42377
Mail: simon.praetorius at tu-dresden.de
Web: www.math.tu-dresden.de/~spraetor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 5733 bytes
Desc: S/MIME-Signatur
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160927/35b91042/attachment.bin>


More information about the vtkusers mailing list