<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
<META content="MSHTML 6.00.6000.17092" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=203071617-16062011><FONT face=Arial color=#0000ff 
size=2>Another option is to write a programmable filter that will take the input 
(from the integrate variables)&nbsp;and write it out using standard python 
commands. You can then reference this in your script.</FONT></SPAN></DIV>
<DIV><SPAN class=203071617-16062011><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=203071617-16062011><FONT face=Arial color=#0000ff size=2>iv = 
IntegrateVariables(Input=blah)</FONT></SPAN></DIV>
<DIV><SPAN class=203071617-16062011><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=203071617-16062011><FONT face=Arial color=#0000ff size=2>pf = 
ProgrammableFilter(Input=pf)</FONT></SPAN></DIV>
<DIV><SPAN class=203071617-16062011><FONT face=Arial color=#0000ff 
size=2>pf.Script = """</FONT></SPAN></DIV>
<DIV><SPAN class=203071617-16062011><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=203071617-16062011><FONT face=Arial color=#0000ff size=2>pdi = 
self.GetInputDataObject(0,0)</FONT></SPAN></DIV>
<DIV><SPAN class=203071617-16062011><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=203071617-16062011><FONT face=Arial color=#0000ff 
size=2>your_var = pdi.GetPointData().GetArray("your_var")</FONT></SPAN></DIV>
<DIV><SPAN class=203071617-16062011><FONT face=Arial color=#0000ff size=2>fout = 
open("results.txt",'a')</FONT></SPAN></DIV>
<DIV><SPAN class=203071617-16062011><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=203071617-16062011><FONT face=Arial color=#0000ff size=2>for i 
in xrange(len(your_var)):</FONT></SPAN></DIV>
<DIV><SPAN class=203071617-16062011><FONT face=Arial color=#0000ff 
size=2>&nbsp;&nbsp;fout.write( "%s %s %s" % (your_var.GetTuple3(i)[0], 
your_var.GetTuple3(i)[1], your_var.GetTuple3(i)[2]) )</FONT></SPAN></DIV>
<DIV><SPAN class=203071617-16062011><FONT face=Arial color=#0000ff 
size=2>fout.close()</FONT></SPAN></DIV>
<DIV><SPAN class=203071617-16062011><FONT face=Arial color=#0000ff 
size=2>"""</FONT></SPAN></DIV>
<DIV><FONT face=Arial color=#0000ff size=2></FONT>&nbsp;</DIV>
<DIV><SPAN class=203071617-16062011><FONT face=Arial color=#0000ff size=2>If you 
have a number of slices stored in a vtkMultiBlockDataSet then you'll have to 
iterate over each of them first.</FONT></SPAN></DIV>
<DIV><SPAN class=203071617-16062011><FONT face=Arial color=#0000ff 
size=2></FONT></SPAN>&nbsp;</DIV>
<DIV><SPAN class=203071617-16062011><FONT face=Arial color=#0000ff 
size=2>Ad</FONT></SPAN></DIV><!-- Converted from text/plain format -->
<P><FONT size=2>===================================<BR><BR>Adriano Gagliardi 
MEng PhD<BR>Business Sector Leader<BR>Computational Aerodynamics<BR>Aircraft 
Research Association Ltd.<BR>Manton Lane<BR>Bedford<BR><BR>Tel: 01234 32 
4644<BR>E-mail: agagliardi@ara.co.uk<BR>Url: www.ara.co.uk </FONT></P>
<DIV>&nbsp;</DIV><BR>
<DIV class=OutlookMessageHeader lang=en-us dir=ltr align=left>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>From:</B> paraview-bounces@paraview.org 
[mailto:paraview-bounces@paraview.org] <B>On Behalf Of </B>Andy 
Bauer<BR><B>Sent:</B> 16 June 2011 18:10<BR><B>To:</B> Stephen 
Wornom<BR><B>Cc:</B> paraview@paraview.org<BR><B>Subject:</B> Re: [Paraview] PV 
3.10.1 using python to slice and integratevariable<BR></FONT><BR></DIV>
<DIV></DIV>You could interactively run through the scripts with pvpython and 
then use dir() and help() to figure out how to write out the information 
properly.&nbsp; You'll probably need to do something 
like:<BR>SetActiveSource(&lt;the filter that connects to your 
writer&gt;)<BR>writer = XMLPolyDataWriter() # most writers take off the vtk 
part<BR>writer.FileName= "file.vtp"<BR>writer.UpdatePipeline()<BR><BR>Hope this 
helps,<BR>Andy<BR><BR>
<DIV class=gmail_quote>On Thu, Jun 16, 2011 at 8:57 AM, Stephen Wornom <SPAN 
dir=ltr>&lt;<A 
href="mailto:stephen.wornom@inria.fr">stephen.wornom@inria.fr</A>&gt;</SPAN> 
wrote:<BR>
<BLOCKQUOTE class=gmail_quote 
style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">pat 
  marion wrote:<BR>
  <BLOCKQUOTE class=gmail_quote 
  style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Did 
    you try python trace? &nbsp;Tools menu --&gt; Start Trace. &nbsp;Then load 
    your data and carry out steps 1, 2, and 3. &nbsp;Tools menu --&gt; Stop 
    Trace.<BR><BR></BLOCKQUOTE><BR>Thanks Pat,<BR>Worked correctly (We saved the 
  .py script for reference)<BR>with the following exception.<BR>The integrate 
  variables opens a spread sheet with the different values.<BR>We then do save 
  data to save the spreadsheet.<BR>Stop trace<BR>*But* the trace does not 
  contain the save spread sheet commands. Therefore we do not see how to 
  generalize the trace.py (add a loop over theta 0 - 180).<BR>Almost there, what 
  do you suggest?<BR>Many thanks for your help.<BR>Stephen<BR>
  <BLOCKQUOTE class=gmail_quote 
  style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">Pat<BR><BR>On 
    Wed, Jun 15, 2011 at 4:39 PM, Stephen Wornom &lt;<A 
    href="mailto:stephen.wornom@inria.fr" 
    target=_blank>stephen.wornom@inria.fr</A> &lt;mailto:<A 
    href="mailto:stephen.wornom@inria.fr" 
    target=_blank>stephen.wornom@inria.fr</A>&gt;&gt; wrote:<BR><BR>&nbsp; 
    &nbsp;We are using PV to analyze flow around a sphere.<BR><BR>&nbsp; 
    &nbsp;1- We extract the surface of the sphere from the mean flow 
    solution.<BR>&nbsp; &nbsp;2- We make a slice in x (say at the center 
    x=0)<BR>&nbsp; &nbsp;3- Then click integrate variables. Result: We get the 
    integrated<BR>&nbsp; &nbsp;values for the circle at x=0.<BR>&nbsp; &nbsp;4- 
    We would like to create a python script do automate this for<BR>&nbsp; 
    &nbsp;say 60 slices.<BR><BR>&nbsp; &nbsp;Would someone share a python script 
    that we could adapt to do<BR>&nbsp; &nbsp;this? (We have zero experience 
    with python).<BR>&nbsp; &nbsp;We would be greatly appreciative!<BR>&nbsp; 
    &nbsp;Stephen<BR><BR>&nbsp; &nbsp;-- &nbsp; &nbsp; <A 
    href="mailto:stephen.wornom@inria.fr" 
    target=_blank>stephen.wornom@inria.fr</A> &lt;mailto:<A 
    href="mailto:stephen.wornom@inria.fr" 
    target=_blank>stephen.wornom@inria.fr</A>&gt;<BR>&nbsp; &nbsp;2004 route des 
    lucioles - BP93<BR>&nbsp; &nbsp;Sophia Antipolis<BR>&nbsp; &nbsp;06902 
    CEDEX<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
    &nbsp; &nbsp; Tel: 04 92 38 50 54<BR>&nbsp; &nbsp;Fax: 04 97 15 53 
    51<BR><BR><BR>&nbsp; 
    &nbsp;_______________________________________________<BR>&nbsp; 
    &nbsp;Powered by <A href="http://www.kitware.com" 
    target=_blank>www.kitware.com</A> &lt;<A href="http://www.kitware.com" 
    target=_blank>http://www.kitware.com</A>&gt;<BR><BR>&nbsp; &nbsp;Visit other 
    Kitware open-source projects at<BR>&nbsp; &nbsp;<A 
    href="http://www.kitware.com/opensource/opensource.html" 
    target=_blank>http://www.kitware.com/opensource/opensource.html</A><BR><BR>&nbsp; 
    &nbsp;Please keep messages on-topic and check the ParaView Wiki 
    at:<BR>&nbsp; &nbsp;<A href="http://paraview.org/Wiki/ParaView" 
    target=_blank>http://paraview.org/Wiki/ParaView</A><BR><BR>&nbsp; 
    &nbsp;Follow this link to subscribe/unsubscribe:<BR>&nbsp; &nbsp;<A 
    href="http://www.paraview.org/mailman/listinfo/paraview" 
    target=_blank>http://www.paraview.org/mailman/listinfo/paraview</A><BR><BR><BR></BLOCKQUOTE><BR><BR>-- 
  <BR><A href="mailto:stephen.wornom@inria.fr" 
  target=_blank>stephen.wornom@inria.fr</A><BR>2004 route des lucioles - 
  BP93<BR>Sophia Antipolis<BR>06902 CEDEX<BR>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 
  &nbsp; &nbsp; &nbsp;<BR>Tel: 04 92 38 50 54<BR>Fax: 04 97 15 53 
  51<BR><BR><BR>_______________________________________________<BR>Powered by <A 
  href="http://www.kitware.com" target=_blank>www.kitware.com</A><BR><BR>Visit 
  other Kitware open-source projects at <A 
  href="http://www.kitware.com/opensource/opensource.html" 
  target=_blank>http://www.kitware.com/opensource/opensource.html</A><BR><BR>Please 
  keep messages on-topic and check the ParaView Wiki at: <A 
  href="http://paraview.org/Wiki/ParaView" 
  target=_blank>http://paraview.org/Wiki/ParaView</A><BR><BR>Follow this link to 
  subscribe/unsubscribe:<BR><A 
  href="http://www.paraview.org/mailman/listinfo/paraview" 
  target=_blank>http://www.paraview.org/mailman/listinfo/paraview</A><BR><BR></BLOCKQUOTE></DIV><BR><p>**********************************************************************<br />This email contains information that is private and confidential and is intended only for the addressee.<br />If you are not the intended recipient please delete it and notify us immediately by e-mailing the sender.<br />Note: All email sent to or from this address may be accessed by someone other than the recipient, for<br />system management and security reasons.<br />Aircraft Research Association Ltd.  Registered in England, Registration No 503668 Registered Office:<br />Manton Lane, Bedford MK41 7PF England VAT No GB 196351245</p><p>**********************************************************************</p>
</BODY></HTML>