<html><body><div style="color:#000; background-color:#fff; font-family:HelveticaNeue, Helvetica Neue, Helvetica, Arial, Lucida Grande, sans-serif;font-size:10pt"><div><span style="background-color: transparent;">wow, thanks a lot for this! I am on a report deadline at the moment but will try it afterwards. I guess the easiest way is just to write integers (1, 2, 3 ...) as the timesteps to the cgns file which should make the mapping work without problems. In any case, I will fiddle around a bit with what you give me, should be able to make it work, if I have serous problems I might contact you again but think this is already all I need :)</span><br></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span style="background-color: transparent;">cheers, tom</span></div><div class="yahoo_quoted" style="display:
block;"> <div style="font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt;"> <div style="font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12pt;"> <div dir="ltr"> <font size="2" face="Arial"> Berk Geveci <berk.geveci@kitware.com> schrieb am 20:35 Dienstag, 20.Mai 2014:<br> </font> </div> <br><br> <div class="y_msg_container"><div id="yiv9205627102"><div><div dir="ltr">OK try this. Apply a Programmable Filter to the csv file. Turn on advanced properties on that panel and use the following scripts:<div><br clear="none"></div><div>Script:</div><div><br clear="none"></div><div><div>oi = self.GetOutputInformation(0)</div>
<div>ut = oi.Get(vtk.vtkStreamingDemandDrivenPipeline.UPDATE_TIME_STEP())</div><div>t = inputs[0].RowData['t']</div><div>output.RowData.append(numpy.transpose(inputs[0].RowData['x'][t==ut]), 'x')</div>
<div>output.RowData.append(numpy.transpose(inputs[0].RowData['y'][t==ut]), 'y')</div><div>output.RowData.append(numpy.transpose(inputs[0].RowData['z'][t==ut]), 'z')</div></div><div><br clear="none"></div>
<div>RequestInformation script:</div><div><br clear="none"></div><div>
<div style="margin:0px;">oi = self.GetOutputInformation(0)</div>
<div style="margin:0px;">oi.Remove(vtk.vtkStreamingDemandDrivenPipeline().TIME_STEPS())</div>
<div style="margin:0px;">oi.Append(vtk.vtkStreamingDemandDrivenPipeline().TIME_STEPS(), 0)</div>
<div style="margin:0px;">oi.Append(vtk.vtkStreamingDemandDrivenPipeline().TIME_STEPS(), 1)</div>
<div style="margin:0px;">oi.Remove(vtk.vtkStreamingDemandDrivenPipeline().TIME_RANGE())</div>
<div style="margin:0px;">oi.Append(vtk.vtkStreamingDemandDrivenPipeline().TIME_RANGE(), 0)</div>
<div style="margin:0px;">oi.Append(vtk.vtkStreamingDemandDrivenPipeline().TIME_RANGE(), 1)</div>
<div style="margin:0px;"><br clear="none"></div><div style="margin:0px;">The csv file looks like:</div><div style="margin:0px;"><br clear="none"></div><div style="margin:0px;">x,y,z,t</div><div style="margin:0px;">0, 0, 0, 0</div><div style="margin:0px;">1, 0, 0, 0</div><div style="margin:0px;">
2, 0, 0, 0</div><div style="margin:0px;">1, 0, 0, 1</div><div style="margin:0px;">2, 0, 0, 1</div><div style="margin:0px;">3, 0, 0, 1</div><div style="margin:0px;"><br clear="none"></div><div style="margin:0px;">If the column names are different, you can adjust the Script code.</div>
<div style="margin:0px;"><br clear="none"></div><div style="margin:0px;">After this filter, you can apply Table to Points and Glyph usual way. The heart of this is the inputs[0].RowData['x'][t==ut] bit. This selects elements from an array that fit a certain criteria. In this case t == ut where t is the time column value and ut is the time value requested from the filter by ParaView's animation engine. If you are running into an issue, make sure that the values in the csv file match exactly the values in the simulation file. If there are round off errors, you may have to implement a more complicated logic in the file to round the ut value to one that is closest in the table.</div>
<div style="margin:0px;"><br clear="none"></div><div style="margin:0px;">Best,</div><div style="margin:0px;">-berk</div></div></div><div class="yiv9205627102yqt8096078391" id="yiv9205627102yqt70659"><div class="yiv9205627102gmail_extra"><br clear="none"><br clear="none"><div class="yiv9205627102gmail_quote">On Mon, May 19, 2014 at 5:41 AM, Tom-Robin Teschner <span dir="ltr"><<a rel="nofollow" shape="rect" ymailto="mailto:tomrobin.teschner@yahoo.de" target="_blank" href="mailto:tomrobin.teschner@yahoo.de">tomrobin.teschner@yahoo.de</a>></span> wrote:<br clear="none">
<blockquote class="yiv9205627102gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt;">
<div><span>Hi Berk, </span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">
<span><br clear="none"></span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span>I think option two would be best as I don't use vtu (at least for my animations) + for the sake of animation I can reduce the csv file to contain only 1 particle per location so the csv file would be indeed small. If you could send me the python file I would be very thankful, could you also let me know how to put it into paraview as i have never
used the python shell before (in paraview). </span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">
<span><br clear="none"></span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span>Thanks, </span></div>
<div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span>Tom<br clear="none"><br clear="none"></span></div>
<div style="display:block;"> <div style="font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt;"> <div style="font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12pt;">
<div dir="ltr"> <font face="Arial"> Berk Geveci <<a rel="nofollow" shape="rect" ymailto="mailto:berk.geveci@kitware.com" target="_blank" href="mailto:berk.geveci@kitware.com">berk.geveci@kitware.com</a>> schrieb am 19:21 Freitag, 16.Mai 2014:<br clear="none"> </font> </div><div><div class="yiv9205627102h5">
<br clear="none">
<br clear="none"> <div><div><div><div dir="ltr">Since you want to sync the two, you can't live without the time information, unless the simulation time values are simply an integer sequence of 0, 1, 2, 3 etc. The time value is what ParaView uses to sync sources. So unless you have this particular case, we need to do something to fix the issue. There are two ways I thought of:<div>
<br clear="none"></div><div>1. Using a pvd file pointing to vtu files</div><div>2. Doing Python magic to extract particles from a single csv file</div><div><br clear="none"></div><div>2 is very doable and fun under two conditions:</div>
<div>a. the number of particles and the number of time steps are relatively small (otherwise the csv file will be too big)</div>
<div>b. you add the time value as another column.</div><div><br clear="none"></div><div>If these hold, I can send you a script that does this. Otherwise, I can send you an example file collection of pvd/vtu files.</div><div>
<br clear="none"></div>
<div>-berk</div></div><div><div><br clear="none"><br clear="none"><div>On Thu, May 15, 2014 at 5:48 PM, Tom-Robin Teschner <span dir="ltr"><<a rel="nofollow" shape="rect" ymailto="mailto:tomrobin.teschner@yahoo.de" target="_blank" href="mailto:tomrobin.teschner@yahoo.de">tomrobin.teschner@yahoo.de</a>></span> wrote:<br clear="none">
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt;">
<div><span>thanks berk, </span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">
<span><br clear="none"></span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">
<span>thanks for the reply. i can live without the time information, but would paraview automatically map the csv file to the flow solution that i would load before?</span></div>
<div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span>the problem is that i have one cgns file containing all flow solutions so i wonder if paraview would know which csv file to use. </span></div>
<div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span>i'll probably give it a try in the next days when i have some time, but thanks again for your reply.</span></div>
<div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><span><br clear="none"></span></div>
<div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">
<span>cheers,</span></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">
<span>tom</span></div>
<div style="display:block;"> <div style="font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt;"> <div style="font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 12pt;">
<div dir="ltr"> <font face="Arial"> Berk Geveci <<a rel="nofollow" shape="rect" ymailto="mailto:berk.geveci@kitware.com" target="_blank" href="mailto:berk.geveci@kitware.com">berk.geveci@kitware.com</a>> schrieb am 15:59 Dienstag, 13.Mai 2014:<br clear="none">
</font> </div><div><div>
<div><div><div><div dir="ltr">Hi Tom-Robin,<div><br clear="none"></div><div>ParaView does not support having a time series of particles within a single csv file. You can have a file series of csv files as described here:</div>
<div><br clear="none"></div><div><a rel="nofollow" shape="rect" target="_blank" href="http://www.paraview.org/Wiki/ParaView/Users_Guide/Loading_Data">http://www.paraview.org/Wiki/ParaView/Users_Guide/Loading_Data</a><br clear="none">
</div><div><br clear="none"></div><div>Unfortunately, you will not be able to specify a time value in this case. ParaView will pick 0, 1, 2 etc.</div><div><br clear="none"></div><div>To be able to specify time values, you will have to use a format such as pvd or Xdmf. Of course, I just noticed that we have absolutely no documentation on the PVD format :-) We'll fix that. Here is some info:</div>
<div><br clear="none"></div><div><a rel="nofollow" shape="rect" target="_blank" href="http://www.cacr.caltech.edu/~slombey/asci/vtk/">http://www.cacr.caltech.edu/~slombey/asci/vtk/</a><br clear="none"></div><div><br clear="none">
</div><div>Xdmf is better documentation.</div><div><br clear="none"></div><div>Both of these formats support ASCII content. Xdmf supports having all of the data in one file although if you have thousands of time steps, the file may get somewhat bulky.</div>
<div><br clear="none"></div><div>-berk</div></div><div><br clear="none"><br clear="none"><div>On Thu, May 8, 2014 at 10:59 AM, Tom-Robin Teschner <span dir="ltr"><<a rel="nofollow" shape="rect" ymailto="mailto:tomrobin.teschner@yahoo.de" target="_blank" href="mailto:tomrobin.teschner@yahoo.de">tomrobin.teschner@yahoo.de</a>></span> wrote:<br clear="none">
<blockquote style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div><div><div style="color: rgb(0, 0, 0); background-color: rgb(255, 255, 255); font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-size: 10pt;">
<div>Hi, </div><div><br clear="none"></div><div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">
I am doing particle tracking at the moment and I am visualise my results with paraview. I have a 3D Navier Stokes solver from which I get a CGNS file with the flow solution (for example velocity and vorticity in x, y and z) and I also get csv file where I store position of particles, which i track inside my code. </div>
<div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;">Now I want to bring them both together, i.e. have an animation of the flowfield (let's say of the x velocity) and on top I want to display the particles at each timestep (so how they move along the flow). the csv file looks something like this (<span style="font-size:10pt;">shorten for visualisation)</span><span style="background-color:transparent;">: </span></div>
<div style="color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; background-color: transparent; font-style: normal;"><br clear="none"></div><div style="background-color:transparent;">
"X" , "Y" , "Z"</div><div style="background-color:transparent;">0.0068 , 0.52500 , 0.005</div><div style="background-color:transparent;">0.0593 , 0.52510 , 0.005</div><div style="background-color:transparent;">
<span style="background-color:transparent;">0.1171 , 0.52542 , 0.005</span> </div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal;">
<br clear="none"></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal;">I have loaded the particles into paraview and then used tabletopoints from the filters but then I get all the particles displayed, instead of getting one particle per timestep. I have tried to use a fourth column for time but I was unable to map that to my animation.</div>
<div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal;"><br clear="none"></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal;">
Does anyone have an idea how to solve this?</div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal;">
<br clear="none"></div><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal;">Kind regards, </div>
<span><font color="#888888"></font></span><div style="background-color: transparent; color: rgb(0, 0, 0); font-size: 13px; font-family: HelveticaNeue, 'Helvetica Neue', Helvetica, Arial, 'Lucida Grande', sans-serif; font-style: normal;">
Tom-Robin
Teschner</div></div></div></div><br clear="none">_______________________________________________<br clear="none">
Powered by <a rel="nofollow" shape="rect" target="_blank" href="http://www.kitware.com/">www.kitware.com</a><br clear="none">
<br clear="none">
Visit other Kitware open-source projects at <a rel="nofollow" shape="rect" target="_blank" href="http://www.kitware.com/opensource/opensource.html">http://www.kitware.com/opensource/opensource.html</a><br clear="none">
<br clear="none">
Please keep messages on-topic and check the ParaView Wiki at: <a rel="nofollow" shape="rect" target="_blank" href="http://paraview.org/Wiki/ParaView">http://paraview.org/Wiki/ParaView</a><br clear="none">
<br clear="none">
Follow this link to subscribe/unsubscribe:<br clear="none">
<a rel="nofollow" shape="rect" target="_blank" href="http://www.paraview.org/mailman/listinfo/paraview">http://www.paraview.org/mailman/listinfo/paraview</a><br clear="none">
<br clear="none"></blockquote></div><br clear="none"></div></div></div><br clear="none"><br clear="none"></div> </div></div></div> </div> </div> </div></div></blockquote></div><br clear="none"></div></div></div></div><br clear="none">
<br clear="none"></div> </div></div></div> </div> </div> </div></div></blockquote></div><br clear="none"></div></div></div></div><br><br></div> </div> </div> </div> </div></body></html>