[Paraview] Programmable Source & MultiBlockDataSet

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Fri Apr 23 14:48:27 EDT 2010


I've added an example to the Wiki showing how to produce timesteps
from programmable source.
http://www.paraview.org/Wiki/Here_are_some_more_examples_of_simple_ParaView_3_python_filters.#Producing_Data_with_Timesteps_.28Source.29

There's one caveat currently. The GUI does not realize the timesteps
being produced, so you will have to manually adjust the time ranges
for the animation using the Animation View.

Utkarsh

2010/4/23 Aurélien Marsan <aur.marsan at gmail.com>:
> Yet I understand why it's not possible to work with TemporalDataSet in
> Paraview.
> The output of the PVDReader is a MultiBlockDataSet, and the PVDReader
> redirect the reader based on the time value.
>
> ... Is it possible to create a programmable source that would be aware of
> the timestep ?
> Or do I have to abandon python and write a reader in the C++ source ?
>
> Le 23 avril 2010 17:15, Aurélien Marsan <aur.marsan at gmail.com> a écrit :
>>
>> ah....
>>
>> So : I use file in format v3d.
>> For a mesh that contains two blocks, they would be called called
>> block1_timestep1.v3d, block2_timestep1.v3d, block1_timestep2.v3d,
>> block2_timestep2.v3d, etc...
>>
>> Actually, I open these v3d_files with a python tool that I have
>> writen, translate them as vtk.vtkStructuredGrid, and write several files on
>> the disk as TimeStep1.vtm, TimeStep2.vtm and Simulation.pvd
>> But this takes a lot a disk space, and reading/writing takes a lot of
>> time.
>>
>> So I would like to open the v3d file directly in paraview.
>> That's why I though to use a Programmable Source in order to read all v3d
>> files and create a "Temporal Data Set".
>>
>> Le 23 avril 2010 16:35, Utkarsh Ayachit <utkarsh.ayachit at kitware.com> a
>> écrit :
>>>
>>> Temporal DataSet! Filters shouldn't be producing temporal dataset
>>> explicitly. Why do you need it?
>>>
>>> Utkarsh
>>>
>>> 2010/4/23 Aurélien Marsan <aur.marsan at gmail.com>:
>>> > thanks !
>>> > And so, could you add "Temporal Data Set" to this commit ?
>>> > Le 23 avril 2010 16:28, Utkarsh Ayachit <utkarsh.ayachit at kitware.com> a
>>> > écrit :
>>> >
>>> >> I've just committed a change to ParaView to allow setting output type
>>> >> to be a multiblock dataset.
>>> >>
>>> >> Commit id: c7472789ba86210e190f398a90eebc081a66d40c
>>> >>
>>> >> Utkarsh
>>> >>
>>> >> 2010/4/23 Aurélien Marsan <aur.marsan at gmail.com>:
>>> >> > I found a solution to do what I wanted to do. Not really elegant,
>>> >> > but it
>>> >> > works.
>>> >> > The best would be to encode the reader in the source code.... but I
>>> >> > don't
>>> >> > know how to do, and have no time for now.
>>> >> >
>>> >> > First, I use the tool Source -> Data Object Generator, and create a
>>> >> > MultiBlockDataSet.
>>> >> >>
>>> >> >> MB{}
>>> >> >
>>> >> >
>>> >> > Then, I use a Programmable Filter, and set the Output Data Type
>>> >> > "Same as
>>> >> > Input".
>>> >> > So I can use this script.
>>> >> >
>>> >> >>
>>> >> >> from Moduleperso import *
>>> >> >> m = MultiBlocFromV3D(........)       # This is a personnal reader
>>> >> >> in
>>> >> >> python, that returns a vtkMultiBlockDataSet
>>> >> >> self.GetOutputDataObject(0).DeepCopy(m)
>>> >> >
>>> >> >
>>> >> > Hope this will help some people who don't want to go in source
>>> >> > code...
>>> >> >
>>> >> > Le 23 avril 2010 14:07, Aurélien Marsan <aur.marsan at gmail.com> a
>>> >> > écrit :
>>> >> >>
>>> >> >> Maybe I have found a way to avoid the Programmable Source...
>>> >> >>
>>> >> >> But Is it possible to export an object created in the python shell
>>> >> >> directly into the pipeline of the paraview interface ?
>>> >> >>
>>> >> >> Le 22 avril 2010 15:36, Aurélien Marsan <aur.marsan at gmail.com> a
>>> >> >> écrit
>>> >> >> :
>>> >> >>>
>>> >> >>> Hi,
>>> >> >>>
>>> >> >>> A new thing I don't know how to do with Paraview.
>>> >> >>> I have written a personnal reader, that creates vtkStructuredGrid
>>> >> >>> from
>>> >> >>> files written in so called format "v3d". So I'm able to construct
>>> >> >>> a
>>> >> >>> MutliBlockDataSet, that is composed of all the Blocks I'm working
>>> >> >>> with.
>>> >> >>>
>>> >> >>> I would like to use "Programmable Source", so we don't need to
>>> >> >>> write
>>> >> >>> the
>>> >> >>> file on the disk before to open it with Paraview.
>>> >> >>> Does "Programmable Source" work with MultiBlockDataSet ? I don't
>>> >> >>> see
>>> >> >>> this
>>> >> >>> class in the Output Data Set Type that we can choose...
>>> >> >>>
>>> >> >>> And is it correct if I write in the Script of the Programmable
>>> >> >>> Filter
>>> >> >>> :
>>> >> >>>
>>> >> >>> from perso import *
>>> >> >>> multiblock = MultiBlockDataSetFromV3D(.....)
>>> >> >>> self.GetOutput().DeepCopy(multiblock)
>>> >> >>>
>>> >> >>> Thanks for help.
>>> >> >>>
>>> >> >>> A.MARSAN
>>> >> >
>>> >> >
>>> >> > _______________________________________________
>>> >> > 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 ParaView Wiki at:
>>> >> > http://paraview.org/Wiki/ParaView
>>> >> >
>>> >> > Follow this link to subscribe/unsubscribe:
>>> >> > http://www.paraview.org/mailman/listinfo/paraview
>>> >> >
>>> >> >
>>> >
>>> >
>>
>
>


More information about the ParaView mailing list