[vtkusers] vtkExodusIIReader: Extract time step value?

Derek Gaston friedmud at gmail.com
Fri Nov 23 12:29:57 EST 2012


Did you ever figure this out?  I'm running into the exact same thing.

I just need to get the times associated with each timestep from an Exodus
file.  Everything else is working beautifully... I just want to display the
current time in my GUI.

Any help here would be greatly appreciated!

Derek


On Mon, Sep 10, 2012 at 10:44 AM, Nico Schlömer <nico.schloemer at gmail.com>wrote:

> I wasn't quite sure if this is the same thing since I then get
>
> ================ *snip* ================
>
> rdr.GetOutputPortInformation(0).Get(vtkStreamingDemandDrivenPipeline.TIME_STEPS())
> ---------------------------------------------------------------------------
> TypeError                                 Traceback (most recent call last)
> <ipython-input-10-dae571687634> in <module>()
> ----> 1
> rdr.GetOutputPortInformation(0).Get(vtkStreamingDemandDrivenPipeline.TIME_STEPS())
>
> TypeError: arguments do not match any overloaded methods
> ================ *snap* ================
>
> --Nico
>
>
>
> On Mon, Sep 10, 2012 at 2:18 PM, David Thompson
> <david.thompson at kitware.com> wrote:
> > Hi Nico,
> >
> >> rdr = vtkExodusIIReader()
> >> ...
> >> rdr.GetOutputInformation(0)
> >>
> >> yields and error saying that "GetOutputInformation" isn't a member of
> >> vtkExodusIIReader.
> >> From <
> http://www.vtk.org/doc/nightly/html/classvtkExodusIIReader-members.html>
> >> I see that it should be there though. Might this be a bug in the
> >> Python interface? This is with VTK 5.8.0.
> >
> > I believe in VTK 5.8 it was named GetOutputPortInformation().
> >
> >   http://www.vtk.org/doc/release/5.8/html/a00128.html
> >
> >         David
> >
> >> On Sat, Sep 8, 2012 at 6:26 PM, David Thompson
> >> <david.thompson at kitware.com> wrote:
> >>> Hi Nico,
> >>>
> >>>> after having read a particular (integer) time step from an Exodus file
> >>>> with the vtkExodusIIReader,
> >>>> http://www.vtk.org/doc/nightly/html/classvtkExodusIIReader.html, how
> >>>> do I extract the actual (float/double) time value that's associated
> >>>> with it?
> >>>
> >>>
> >>> Filters that generate temporal data should set the
> vtkStreamingDemandDrivenPipeline::TIME_STEPS() key on their corresponding
> output's vtkInformation object. Access to any vtkAlgorithm's output
> information is available via the GetOutputInformation() method.
> >>>
> >>> Using the exodus reader on can.ex2 as an example, here's a vtkpython
> script to get time step information:
> >>>
> >>> from vtk import *
> >>> rdr = vtkExodusIIReader()
> >>> rdr.SetFileName('/path/to/ParaViewData/Data/can.ex2')
> >>> rdr.Update()
> >>>
> rdr.GetOutputInformation(0).Get(vtkStreamingDemandDrivenPipeline.TIME_STEPS())
> >>>
> >>> This returns a vector of doubles. You can use the integer time step as
> an index into the vector.
> >>>
> >>>        David
> >
> _______________________________________________
> 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
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20121123/8b71eeb4/attachment.htm>


More information about the vtkusers mailing list