CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   ParaView (https://www.cfd-online.com/Forums/paraview/)
-   -   [General] Get the velocity values of a streamline (https://www.cfd-online.com/Forums/paraview/171630-get-velocity-values-streamline.html)

lybhur May 12, 2016 07:59

Get the velocity values of a streamline
 
1 Attachment(s)
Hi all,

Here is a piece of code for a programmable filter. The idea is to get the all velocity values of each streamlines.

If you look at the streamtracer output in a spreadsheet view, and in particular the integration time column, you will notice that each streamline begin with a zero.
So to isolate each streamline, I check all the zeros of the integration time column.

Then I want to use the "j" variable to slice the velocity array


Code:


from vtk.numpy_interface import dataset_adapter as dsa
from vtk.numpy_interface import algorithms as algs

input0 = inputs[0]
IntegrationTime = input0.PointData["IntegrationTime"]
Velocity = input0.PointData["Velocity"]

index = algs.where(IntegrationTime==0)

j=index[0][1]

print'j value : ', j
print'j type : ', type(j)
print j[0]

I thought that the variable "j" would be an integer but I think there is a bug because here is the result I have got in the output window (picture enclosed)

What did I missed ?!


All times are GMT -4. The time now is 15:06.