[vtkusers] Choosing time for vtkOpenFOAMReader

David E DeMarle dave.demarle at kitware.com
Wed Nov 2 13:40:45 EDT 2016


In vtk 6.3 it was:
anAlgorithm->UpdateInformation();
anAlgorithm->SetUpdateTimeStep(0.5);
anAlgorithm->Update();
Try that.

In vtk 7.1 it is:
anAlgorithm->UpdateTimeSep(0.5);
Since Berk cleaned up the parts of the pipeline that caused issues like you
are seeing.



David E DeMarle
Kitware, Inc.
R&D Engineer
21 Corporate Drive
Clifton Park, NY 12065-8662
Phone: 518-881-4909

On Wed, Nov 2, 2016 at 12:43 PM, Timofey Mukha <timofey.mukha at it.uu.se>
wrote:

> Hello!
>
> I am trying to write a python script for doing some stuff with an OpenFOAM
> case. Everything works great, except that I can't choose the time-value
> that I want the reader to get the data for.
>
> I have found the SetTimeValue() function which is supposed to do the job I
> think, but it doesn't -- the first availbale time-value is always used.
> Here is how I use the reader:
>
> reader = vtk.vtkOpenFOAMReader()
> reader.SetFileName(path)
> reader.CreateCellToPointOff()
> reader.DisableAllPointArrays()
> reader.Update()
> print(vtk_to_numpy(reader.GetTimeValues())) # Grab the available timesteps
> reader.SetTimeValue(vtk_to_numpy(reader.GetTimeValues())[-1]) # Try to
> load the latest time
> reader.Update()
>
> I use the version provided by the Anaconda python disstro, 6.3.0 I believe.
>
> Thanks in advance,
>
> Timofey
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at http://www.kitware.com/opensou
> rce/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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20161102/e1b08874/attachment.html>


More information about the vtkusers mailing list