[Paraview] Problem with custom time-aware reader

Moreland, Kenneth kmorel at sandia.gov
Sun Sep 6 12:20:26 EDT 2009


OOPS!  STOP!  BACK UP!  I looked at your code too quickly, misunderstood what you were doing, and gave totally the wrong advise.  Please ignore everything I said before.

If you are using the file series reader, then your reader should be completely ignorant of any file series.  It should read in only the file it is given, and if that file changes then it should ignore whatever file it was previously given.  Therefore, the problem with your reader is that it is trying to collect time information over all the files.  That is the job of the file series reader and as a result it is fouling up the operation of the file series reader.

So, what your reader should do is read in the time value in the file it is given, set the TIME_STEPS key to ONLY that time value and set the TIME_RANGE to be only that range.  Attached is a modified version of your reader example that has all that time series management stripped out.  The resulting code is much smaller and actually works.

Specifically what was happening was that by the time RequestInformation was called on the last time step, your reader had collected information about all the time steps and returned all the time steps in all the files.  The file series reader thought you meant that the last file contained all those time steps (some file formats do contain multiple time steps in a single file).  Because your reader said that the last file contained all the time steps, the file series reader was using that last file for all the time steps.

-Ken


On 9/3/09 11:24 PM, "Karl König" <kkoenig11 at web.de> wrote:

Hi Ken,

Thanks again for your input.

> You have the basic idea.  The seg fault is probably happening because
> the destructor of you class is trying to free the pointer you set to it,
> which is probably actually pointing to some spot on the stack.
>
> You are probably not seeing this mapping/lookup in the VTK IO classes
> because you are looking at classes that do not directly support time
> (such as the legacy readers and XML readers).  Those readers read
> exactly one file with one time step in it.  ParaView has a magic meta
> reader called a FileSeriesReader that takes a real reader and a
> collection of files and multiplexes the files to the reader based on the
> time.
>
> In retrospect, this is probably an easier way to go (assuming your final
> reader is a file series like this).  Documentation on using the
> FileSeriesReader is on the Wiki at
>
>     http://www.paraview.org/Wiki/Restarted_Simulation_Readers#Customized_Restart_Reader

I've been aware of that page. In fact, FooReader.xml and
FooReaderGUI.xml of the tarball I posted already did make use of the
FileSeriesReader. Together with calling
  outInfo->Set(vtkStreamingDemandDrivenPipeline::TIME_STEPS(), ...)
  outInfo->Set(vtkStreamingDemandDrivenPipeline::TIME_RANGE(), ...)
in RequestInformation it is responsible for inspecting all files of the
series between selecting them in the file open dialog and appearing of
the Apply button.

Anyway, I'll try to use again the mapping time step value -> file name
and iron out the segfault on deletion of the reader object.

I'll post the solution in case I can work it out and someone is interested.

Karl





   ****      Kenneth Moreland
    ***      Sandia National Laboratories
***********
*** *** ***  email: kmorel at sandia.gov
**  ***  **  phone: (505) 844-8919
    ***      web:   http://www.cs.unm.edu/~kmorel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20090906/280c6937/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vtkFooReader.cxx
Type: application/octet-stream
Size: 3073 bytes
Desc: vtkFooReader.cxx
URL: <http://www.paraview.org/pipermail/paraview/attachments/20090906/280c6937/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: vtkFooReader.h
Type: application/octet-stream
Size: 988 bytes
Desc: vtkFooReader.h
URL: <http://www.paraview.org/pipermail/paraview/attachments/20090906/280c6937/attachment-0001.obj>


More information about the ParaView mailing list