<div dir="ltr"><div>I added a few lines to my script to address this issue. I guess that I can't see the coordinates array directly in the <font face="monospace, monospace">NS_quad_vtk</font> object due to the structure of the VTK file. I create a Calculator, calling the z coordinate as function definition, and then get the maximum of this object.</div><div><br></div><div>Thanks,</div><div><br></div><div><font face="monospace, monospace">======START OF SCRIPT</font></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</font></div><div><font face="monospace, monospace">zEnd    = 25</font></div><div><font face="monospace, monospace"><br></font></div><div><span style="font-family:monospace,monospace">def velZaxis(filename):</span><br></div><div><font face="monospace, monospace"><span class="" style="white-space:pre">        </span>W = list(0 for i in range(0,Nstep))</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><font face="monospace, monospace"><br></font></div><div><font face="monospace, monospace"><span class="" style="white-space:pre">       </span>NS_quad_vtk = OpenDataFile(filename)</font></div><div><font face="monospace, monospace"><div><span class="" style="white-space:pre">     </span>try:</div><div><span class="" style="white-space:pre">               </span>TempCalc=Calculator()</div><div><span class="" style="white-space:pre">              </span>TempCalc.Function='coordsZ'</div><div><span class="" style="white-space:pre">                </span>TempCalc.ResultArrayName='PointZ'</div><div><span class="" style="white-space:pre">          </span>maxZ = Calc.PointData["PointZ"].GetRange(0)[1]</div><div><span class="" style="white-space:pre">           </span>Delete(TempCalc)</div><div><span class="" style="white-space:pre">   </span>except Exception as e:</div><div><span class="" style="white-space:pre">             </span>maxZ    = zEnd</div></font></div><div><font face="monospace, monospace"><span class="" style="white-space:pre">        </span>PlotOverLine1 = PlotOverLine( Source="High Resolution Line Source" )</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, maxZ]</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*(maxZ/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><font face="monospace, monospace">======END OF SCRIPT</font></div></div><div class="gmail_extra"><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><i><font face="arial, helvetica, sans-serif">     </font><font face="'times new roman', serif">LADYF</font></i></div><div><i style="font-family:arial,helvetica,sans-serif">     </i><font face="'times new roman', serif"><span style="font-size:x-small">Lab. de dynamique </span><span style="font-size:x-small">des fluides</span></font></div><div><div><div><div>(514) 340 4711 ext 2489<br>Local: C-318.21.3<b><br></b>------------------------------------<br></div></div></div></div></div></div>
<br><div class="gmail_quote">On Mon, May 4, 2015 at 12:58 PM, Felix Salazar <span dir="ltr"><<a href="mailto:felix.salazar@polymtl.ca" target="_blank">felix.salazar@polymtl.ca</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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 style="white-space:pre-wrap">      </span>W = list(0 for i in range(0,Nstep))<br></font></div><div><font face="monospace, monospace"><span style="white-space:pre-wrap">     </span>z = list(0.0 for i in range(0,Nstep))</font></div><div><span style="white-space:pre-wrap"><font face="monospace, monospace"><br></font></span></div><div><font face="monospace, monospace"><span style="white-space:pre-wrap">     </span>NS_quad_vtk = OpenDataFile(filename)<br></font></div><div><font face="monospace, monospace"><span style="white-space:pre-wrap">    </span>PlotOverLine1 = PlotOverLine( Source="High Resolution Line Source" )<br></font></div><div><font face="monospace, monospace"><span style="white-space:pre-wrap">  </span>PlotOverLine1.Source.Point1 = [0.0, 0.0, 0.0]</font></div><div><font face="monospace, monospace"><span style="white-space:pre-wrap">     </span>PlotOverLine1.Source.Point2 = [0.0, 0.0, zEnd]</font></div><div><font face="monospace, monospace"><span style="white-space:pre-wrap">    </span>PlotOverLine1.Source.Resolution = Nstep</font></div><div><font face="monospace, monospace"><span style="white-space:pre-wrap">   </span>for i in range (0,Nstep):</font></div><div><font face="monospace, monospace"><span style="white-space:pre-wrap">         </span>z[i] = i*(zEnd/float(Nstep))</font></div><div><font face="monospace, monospace"><span style="white-space:pre-wrap">              </span>W[i]=servermanager.Fetch(PlotOverLine1,0).GetPointData().GetArray("U+V+W").GetTuple3(i)[2]</font></div><div><font face="monospace, monospace"><span style="white-space:pre-wrap">      </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>------------------------------------<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>
</blockquote></div><br></div>