<div dir="ltr"><div>Hello community,</div><div><br></div><div>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.</div><div><br></div><div>======START OF SCRIPT<br></div><div><div><div><font face="monospace, monospace">#!/bin/pvpython</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">try: paraview.simple</font></div><div><font face="monospace, monospace">except: from paraview.simple import *</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">Nstep = 500<br></font></div><div><font face="monospace, monospace">zEnd = 25</font></div><div><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace">def velZaxis(filename):</font></div><div><font face="monospace, monospace"><span class="" style="white-space:pre"> </span>W = list(0 for i in range(0,Nstep))<br></font></div><div><font face="monospace, monospace"><span class="" style="white-space:pre"> </span>z = list(0.0 for i in range(0,Nstep))</font></div><div><span class="" style="white-space:pre"><font face="monospace, monospace"><br></font></span></div><div><font face="monospace, monospace"><span class="" style="white-space:pre"> </span>NS_quad_vtk = OpenDataFile(filename)<br></font></div><div><font face="monospace, monospace"><span class="" style="white-space:pre"> </span>PlotOverLine1 = PlotOverLine( Source="High Resolution Line Source" )<br></font></div><div><font face="monospace, monospace"><span class="" style="white-space:pre"> </span>PlotOverLine1.Source.Point1 = [0.0, 0.0, 0.0]</font></div><div><font face="monospace, monospace"><span class="" style="white-space:pre"> </span>PlotOverLine1.Source.Point2 = [0.0, 0.0, zEnd]</font></div><div><font face="monospace, monospace"><span class="" style="white-space:pre"> </span>PlotOverLine1.Source.Resolution = Nstep</font></div><div><font face="monospace, monospace"><span class="" style="white-space:pre"> </span>for i in range (0,Nstep):</font></div><div><font face="monospace, monospace"><span class="" style="white-space:pre"> </span>z[i] = i*(zEnd/float(Nstep))</font></div><div><font face="monospace, monospace"><span class="" style="white-space:pre"> </span>W[i]=servermanager.Fetch(PlotOverLine1,0).GetPointData().GetArray("U+V+W").GetTuple3(i)[2]</font></div><div><font face="monospace, monospace"><span class="" style="white-space:pre"> </span>return z, W</font></div></div></div><div>======END OF SCRIPT</div><div><br></div><div><br></div><div>Now, I was wondering if someone could give me some tips on how to set the value of <font face="monospace, monospace">zEnd</font> based on the actual maximum value in the geometry, instead of using a fixed value. Is there any recommended way to obtain this information?</div><div><br></div><div>Thanks</div><div><br></div><br clear="all"><div><div class="gmail_signature">------------------------------------<b><br>Félix Salazar<br></b><i><a href="mailto:felix.salazar@polymtl.ca" target="_blank"><span style="color:rgb(51,102,255)">felix.salazar@polymtl.ca</span></a></i><b><br></b><font size="1">Étudiant au doctorat - PhD Student</font><div><font face="arial, helvetica, sans-serif"><i>École Polytechnique de Montréal</i></font></div><div><div><div><div>------------------------------------<br></div></div></div></div></div></div>
</div>