Getting coordinates to calculator

Submitted by tkulju on Mon, 08/06/2012 - 13:51

Hi all!
I'm trying to extract some parts of the data, and for this purpose I'm trying to create a new field with 'Calculator' function of paraview. The idea is to access the particle positions and calculate their radial position. The problem is, that when I'm trying to access the particle positions, the particle velocities are picked up. Any idea how the access to the particle positions correctly via 'Calculator' or in some other way? I'm using the liggghts_reader, which works quite nicely. The particle positions seems to be displayed correctly.

Kindest Regards,

Timo

DanielDroop | Tue, 08/28/2012 - 08:55

Hi Timo,
I'm working with the LPP script and this works for me to calculate the position against the z-axis:

Calculator Filter:
sqrt(coordsX*coordsX+coordsY*coordsY)

ProgrammableFilter:
x = inputs[0].Points[:,0]
y = inputs[0].Points[:,1]
z = inputs[0].Points[:,2]
output.PointData.append(x, "x")
output.PointData.append(y, "y")
output.PointData.append(z, "z")
r = sqrt(x*x+y*y)
output.PointData.append(r, "r")

Best regards,
Daniel