[Paraview] Getting the extreme value of the coordinates in pvpython
Felix Salazar
felix.salazar at polymtl.ca
Mon May 4 12:58:44 EDT 2015
Hello community,
I'm writing a pvpython script to export the 3rd component of the velocity
vector on the z-axis of my domain. Here's a fragment of the script used.
Not very refined, but does the trick.
======START OF SCRIPT
#!/bin/pvpython
try: paraview.simple
except: from paraview.simple import *
Nstep = 500
zEnd = 25
def velZaxis(filename):
W = list(0 for i in range(0,Nstep))
z = list(0.0 for i in range(0,Nstep))
NS_quad_vtk = OpenDataFile(filename)
PlotOverLine1 = PlotOverLine( Source="High Resolution Line Source" )
PlotOverLine1.Source.Point1 = [0.0, 0.0, 0.0]
PlotOverLine1.Source.Point2 = [0.0, 0.0, zEnd]
PlotOverLine1.Source.Resolution = Nstep
for i in range (0,Nstep):
z[i] = i*(zEnd/float(Nstep))
W[i]=servermanager.Fetch(PlotOverLine1,0).GetPointData().GetArray("U+V+W").GetTuple3(i)[2]
return z, W
======END OF SCRIPT
Now, I was wondering if someone could give me some tips on how to set the
value of zEnd based on the actual maximum value in the geometry, instead of
using a fixed value. Is there any recommended way to obtain this
information?
Thanks
------------------------------------
*Félix Salazar**felix.salazar at polymtl.ca <felix.salazar at polymtl.ca>*
Étudiant au doctorat - PhD Student
*École Polytechnique de Montréal*
------------------------------------
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20150504/4a689764/attachment.html>
More information about the ParaView
mailing list