<div>... I answer myself : I have to use the req_timestep variable, and do something like</div>
<div> </div>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">ModulePerso.ReadMultiBlockFromV3D(<strong>&#39;filename%s&#39;%(req_timestep)</strong>)</blockquote>
<div> </div>
<div>If that could help other people, there is on the internet a presentation that explains quite well how time is managed in Paraview, especially slide 32.</div>
<div><a href="http://www.itk.org/Wiki/images/2/20/IEEE08_Time-In-ParaView.ppt">http://www.itk.org/Wiki/images/2/20/IEEE08_Time-In-ParaView.ppt</a><br><br></div>
<div class="gmail_quote">Le 26 avril 2010 10:39, Aurélien Marsan <span dir="ltr">&lt;<a href="mailto:aur.marsan@gmail.com">aur.marsan@gmail.com</a>&gt;</span> a écrit :<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>Thank for this example. <br> <br>But I&#39;m trying to apply this to my case, and have one question again ..... :-|<br> <br> # TODO: Generate the data as you want.<br> <br>---&gt; That should be the DataSet at one timestep ?<br>
How does the programmable source handle the change of the filename to read ?<br>Should I use a command sort of &quot;executive.GetActiveTimeStep()&quot; when I define the filename to read ?</div>
<div> </div>
<div>Le 23 avril 2010 20:48, Utkarsh Ayachit <span dir="ltr">&lt;<a href="mailto:utkarsh.ayachit@kitware.com" target="_blank">utkarsh.ayachit@kitware.com</a>&gt;</span> a écrit :<br></div>
<div>
<div></div>
<div class="h5">
<div class="gmail_quote">
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">I&#39;ve added an example to the Wiki showing how to produce timesteps<br>from programmable source.<br><a href="http://www.paraview.org/Wiki/Here_are_some_more_examples_of_simple_ParaView_3_python_filters.#Producing_Data_with_Timesteps_.28Source.29" target="_blank">http://www.paraview.org/Wiki/Here_are_some_more_examples_of_simple_ParaView_3_python_filters.#Producing_Data_with_Timesteps_.28Source.29</a><br>
<br>There&#39;s one caveat currently. The GUI does not realize the timesteps<br>being produced, so you will have to manually adjust the time ranges<br>for the animation using the Animation View.<br>
<div>
<div></div>
<div><br>Utkarsh<br><br>2010/4/23 Aurélien Marsan &lt;<a href="mailto:aur.marsan@gmail.com" target="_blank">aur.marsan@gmail.com</a>&gt;:<br>&gt; Yet I understand why it&#39;s not possible to work with TemporalDataSet in<br>
&gt; Paraview.<br>&gt; The output of the PVDReader is a MultiBlockDataSet, and the PVDReader<br>&gt; redirect the reader based on the time value.<br>&gt;<br>&gt; ... Is it possible to create a programmable source that would be aware of<br>
&gt; the timestep ?<br>&gt; Or do I have to abandon python and write a reader in the C++ source ?<br>&gt;<br>&gt; Le 23 avril 2010 17:15, Aurélien Marsan &lt;<a href="mailto:aur.marsan@gmail.com" target="_blank">aur.marsan@gmail.com</a>&gt; a écrit :<br>
&gt;&gt;<br>&gt;&gt; ah....<br>&gt;&gt;<br>&gt;&gt; So : I use file in format v3d.<br>&gt;&gt; For a mesh that contains two blocks, they would be called called<br>&gt;&gt; block1_timestep1.v3d, block2_timestep1.v3d, block1_timestep2.v3d,<br>
&gt;&gt; block2_timestep2.v3d, etc...<br>&gt;&gt;<br>&gt;&gt; Actually, I open these v3d_files with a python tool that I have<br>&gt;&gt; writen, translate them as vtk.vtkStructuredGrid, and write several files on<br>&gt;&gt; the disk as TimeStep1.vtm, TimeStep2.vtm and Simulation.pvd<br>
&gt;&gt; But this takes a lot a disk space, and reading/writing takes a lot of<br>&gt;&gt; time.<br>&gt;&gt;<br>&gt;&gt; So I would like to open the v3d file directly in paraview.<br>&gt;&gt; That&#39;s why I though to use a Programmable Source in order to read all v3d<br>
&gt;&gt; files and create a &quot;Temporal Data Set&quot;.<br>&gt;&gt;<br>&gt;&gt; Le 23 avril 2010 16:35, Utkarsh Ayachit &lt;<a href="mailto:utkarsh.ayachit@kitware.com" target="_blank">utkarsh.ayachit@kitware.com</a>&gt; a<br>
&gt;&gt; écrit :<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Temporal DataSet! Filters shouldn&#39;t be producing temporal dataset<br>&gt;&gt;&gt; explicitly. Why do you need it?<br>&gt;&gt;&gt;<br>&gt;&gt;&gt; Utkarsh<br>&gt;&gt;&gt;<br>
&gt;&gt;&gt; 2010/4/23 Aurélien Marsan &lt;<a href="mailto:aur.marsan@gmail.com" target="_blank">aur.marsan@gmail.com</a>&gt;:<br>&gt;&gt;&gt; &gt; thanks !<br>&gt;&gt;&gt; &gt; And so, could you add &quot;Temporal Data Set&quot; to this commit ?<br>
&gt;&gt;&gt; &gt; Le 23 avril 2010 16:28, Utkarsh Ayachit &lt;<a href="mailto:utkarsh.ayachit@kitware.com" target="_blank">utkarsh.ayachit@kitware.com</a>&gt; a<br>&gt;&gt;&gt; &gt; écrit :<br>&gt;&gt;&gt; &gt;<br>&gt;&gt;&gt; &gt;&gt; I&#39;ve just committed a change to ParaView to allow setting output type<br>
&gt;&gt;&gt; &gt;&gt; to be a multiblock dataset.<br>&gt;&gt;&gt; &gt;&gt;<br>&gt;&gt;&gt; &gt;&gt; Commit id: c7472789ba86210e190f398a90eebc081a66d40c<br>&gt;&gt;&gt; &gt;&gt;<br>&gt;&gt;&gt; &gt;&gt; Utkarsh<br>&gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt;&gt; &gt;&gt; 2010/4/23 Aurélien Marsan &lt;<a href="mailto:aur.marsan@gmail.com" target="_blank">aur.marsan@gmail.com</a>&gt;:<br>&gt;&gt;&gt; &gt;&gt; &gt; I found a solution to do what I wanted to do. Not really elegant,<br>
&gt;&gt;&gt; &gt;&gt; &gt; but it<br>&gt;&gt;&gt; &gt;&gt; &gt; works.<br>&gt;&gt;&gt; &gt;&gt; &gt; The best would be to encode the reader in the source code.... but I<br>&gt;&gt;&gt; &gt;&gt; &gt; don&#39;t<br>&gt;&gt;&gt; &gt;&gt; &gt; know how to do, and have no time for now.<br>
&gt;&gt;&gt; &gt;&gt; &gt;<br>&gt;&gt;&gt; &gt;&gt; &gt; First, I use the tool Source -&gt; Data Object Generator, and create a<br>&gt;&gt;&gt; &gt;&gt; &gt; MultiBlockDataSet.<br>&gt;&gt;&gt; &gt;&gt; &gt;&gt;<br>&gt;&gt;&gt; &gt;&gt; &gt;&gt; MB{}<br>
&gt;&gt;&gt; &gt;&gt; &gt;<br>&gt;&gt;&gt; &gt;&gt; &gt;<br>&gt;&gt;&gt; &gt;&gt; &gt; Then, I use a Programmable Filter, and set the Output Data Type<br>&gt;&gt;&gt; &gt;&gt; &gt; &quot;Same as<br>&gt;&gt;&gt; &gt;&gt; &gt; Input&quot;.<br>
&gt;&gt;&gt; &gt;&gt; &gt; So I can use this script.<br>&gt;&gt;&gt; &gt;&gt; &gt;<br>&gt;&gt;&gt; &gt;&gt; &gt;&gt;<br>&gt;&gt;&gt; &gt;&gt; &gt;&gt; from Moduleperso import *<br>&gt;&gt;&gt; &gt;&gt; &gt;&gt; m = MultiBlocFromV3D(........)       # This is a personnal reader<br>
&gt;&gt;&gt; &gt;&gt; &gt;&gt; in<br>&gt;&gt;&gt; &gt;&gt; &gt;&gt; python, that returns a vtkMultiBlockDataSet<br>&gt;&gt;&gt; &gt;&gt; &gt;&gt; self.GetOutputDataObject(0).DeepCopy(m)<br>&gt;&gt;&gt; &gt;&gt; &gt;<br>&gt;&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt;&gt; &gt; Hope this will help some people who don&#39;t want to go in source<br>&gt;&gt;&gt; &gt;&gt; &gt; code...<br>&gt;&gt;&gt; &gt;&gt; &gt;<br>&gt;&gt;&gt; &gt;&gt; &gt; Le 23 avril 2010 14:07, Aurélien Marsan &lt;<a href="mailto:aur.marsan@gmail.com" target="_blank">aur.marsan@gmail.com</a>&gt; a<br>
&gt;&gt;&gt; &gt;&gt; &gt; écrit :<br>&gt;&gt;&gt; &gt;&gt; &gt;&gt;<br>&gt;&gt;&gt; &gt;&gt; &gt;&gt; Maybe I have found a way to avoid the Programmable Source...<br>&gt;&gt;&gt; &gt;&gt; &gt;&gt;<br>&gt;&gt;&gt; &gt;&gt; &gt;&gt; But Is it possible to export an object created in the python shell<br>
&gt;&gt;&gt; &gt;&gt; &gt;&gt; directly into the pipeline of the paraview interface ?<br>&gt;&gt;&gt; &gt;&gt; &gt;&gt;<br>&gt;&gt;&gt; &gt;&gt; &gt;&gt; Le 22 avril 2010 15:36, Aurélien Marsan &lt;<a href="mailto:aur.marsan@gmail.com" target="_blank">aur.marsan@gmail.com</a>&gt; a<br>
&gt;&gt;&gt; &gt;&gt; &gt;&gt; écrit<br>&gt;&gt;&gt; &gt;&gt; &gt;&gt; :<br>&gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>&gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; Hi,<br>&gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>&gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; A new thing I don&#39;t know how to do with Paraview.<br>
&gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; I have written a personnal reader, that creates vtkStructuredGrid<br>&gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; from<br>&gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; files written in so called format &quot;v3d&quot;. So I&#39;m able to construct<br>
&gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; a<br>&gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; MutliBlockDataSet, that is composed of all the Blocks I&#39;m working<br>&gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; with.<br>&gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; I would like to use &quot;Programmable Source&quot;, so we don&#39;t need to<br>&gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; write<br>&gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; the<br>&gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; file on the disk before to open it with Paraview.<br>
&gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; Does &quot;Programmable Source&quot; work with MultiBlockDataSet ? I don&#39;t<br>&gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; see<br>&gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; this<br>&gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; class in the Output Data Set Type that we can choose...<br>
&gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>&gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; And is it correct if I write in the Script of the Programmable<br>&gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; Filter<br>&gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; :<br>
&gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>&gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; from perso import *<br>&gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; multiblock = MultiBlockDataSetFromV3D(.....)<br>&gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; self.GetOutput().DeepCopy(multiblock)<br>
&gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>&gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; Thanks for help.<br>&gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>&gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; A.MARSAN<br>&gt;&gt;&gt; &gt;&gt; &gt;<br>&gt;&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt;&gt; &gt; _______________________________________________<br>&gt;&gt;&gt; &gt;&gt; &gt; Powered by <a href="http://www.kitware.com/" target="_blank">www.kitware.com</a><br>&gt;&gt;&gt; &gt;&gt; &gt;<br>&gt;&gt;&gt; &gt;&gt; &gt; Visit other Kitware open-source projects at<br>
&gt;&gt;&gt; &gt;&gt; &gt; <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>&gt;&gt;&gt; &gt;&gt; &gt;<br>&gt;&gt;&gt; &gt;&gt; &gt; Please keep messages on-topic and check the ParaView Wiki at:<br>
&gt;&gt;&gt; &gt;&gt; &gt; <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br>&gt;&gt;&gt; &gt;&gt; &gt;<br>&gt;&gt;&gt; &gt;&gt; &gt; Follow this link to subscribe/unsubscribe:<br>
&gt;&gt;&gt; &gt;&gt; &gt; <a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>&gt;&gt;&gt; &gt;&gt; &gt;<br>&gt;&gt;&gt; &gt;&gt; &gt;<br>&gt;&gt;&gt; &gt;<br>
&gt;&gt;&gt; &gt;<br>&gt;&gt;<br>&gt;<br>&gt;<br></div></div></blockquote></div><br></div></div></blockquote></div><br>