[vtkusers] Choosing time for vtkOpenFOAMReader

Timofey Mukha timofey.mukha at it.uu.se
Thu Nov 3 07:21:56 EDT 2016


Dear David,

Thank you for the fast reply! I am trying to use your tip, but since I 
am very new to VTK it is not working out well for me.

Could you elaborate a bit, what would "anAlgorithm" be. A child to 
vtkAlgorithm? The thing is none of the objects I create seem to have the 
SetUpdateTimeStep() as a member. Browsing doxygen made me think that it 
is a member of vtkStreamingDemandDrivenPipeline, is that something I 
should have in the script?

Kind regards,

Timofey


On 2016-11-02 18:40, David E DeMarle wrote:
> 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 
> <mailto: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 <http://www.kitware.com>
>
>     Visit other Kitware open-source projects at
>     http://www.kitware.com/opensource/opensource.html
>     <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 <http://www.vtk.org/Wiki/VTK_FAQ>
>
>     Search the list archives at:
>     http://markmail.org/search/?q=vtkusers
>     <http://markmail.org/search/?q=vtkusers>
>
>     Follow this link to subscribe/unsubscribe:
>     http://public.kitware.com/mailman/listinfo/vtkusers
>     <http://public.kitware.com/mailman/listinfo/vtkusers>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20161103/68c67efd/attachment.html>


More information about the vtkusers mailing list