Output should be vtkTable. By the way, if you have numpy installed, this could be done much more efficiently and in less code. See<div><br></div><div><a href="http://paraview.org/Wiki/ParaView/Users_Guide/Python_Programmable_Filter">http://paraview.org/Wiki/ParaView/Users_Guide/Python_Programmable_Filter</a><br>

</div><div><a href="http://paraview.org/Wiki/ParaView/Users_Guide/Python_Calculator">http://paraview.org/Wiki/ParaView/Users_Guide/Python_Calculator</a><br></div><div><br></div><div>You may also want to check the numpy documentation.</div>

<div><br></div><div>In general, if your data is medium to large, you want to avoid for loops over all cells/points in Python.</div><div><br></div><div>Best,</div><div>-berk</div><div class="gmail_extra"><br><br><div class="gmail_quote">

On Thu, Nov 29, 2012 at 11:35 PM, Scott Ripplinger <span dir="ltr">&lt;<a href="mailto:bigbluedart@gmail.com" target="_blank">bigbluedart@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

I am attempting to run an analysis on some data which requires summing up some numbers down to a single value for the whole domain for each time step.  I&#39;m having trouble figuring out how to get the output and what VTK classes and functions to use.  Here is what I have so far:<div>


<br></div><div><p style="margin:0px"><font size="1">import math</font></p>
<p style="margin:0px"><font size="1">input = self.GetInputDataObject(0,0)</font></p>
<p style="margin:0px"><font size="1">output = self.GetOutputDataObject(0)</font></p>
<p style="margin:0px"><font size="1">numPoints = input.GetNumberOfPoints()</font></p>
<p style="margin:0px"><font size="1">points = input.GetPointData()</font></p>
<p style="margin:0px"></p>
<p style="margin:0px"><font size="1">SurfCvg = 0</font></p>
<p style="margin:0px"><font size="1">for i in xrange(numPoints):</font></p>
<p style="margin:0px"><font size="1"> d = points.GetArray(&#39;d&#39;).GetValue(i)</font></p>
<p style="margin:0px"><font size="1"> coords = input.GetPoint(i)</font></p>
<p style="margin:0px"><font size="1"> z = coords[2]</font></p>
<p style="margin:0px"><font size="1"> h = 0.00015 - abs(z - 0.00015) - 0.5*d</font></p><p style="margin:0px"><span style="font-size:x-small"> H0 = 2*h/d</span><br></p>
<p style="margin:0px"><font size="1"> if (H0 &lt; 0.002):</font></p>
<p style="margin:0px"><font size="1">  SurfCvg = SurfCvg + 0.25*math.pi*d*d</font></p>
<p style="margin:0px"></p>
<p style="margin:0px"><font size="1">Theta = SurfCvg/(0.01*0.001)</font></p>
<p style="margin:0px"></p>
<p style="margin:0px"><font size="1">outputarray = vtk.vtkFloatArray()</font></p>
<p style="margin:0px"><font size="1">outputarray.SetNumberOfValues(1)</font></p>
<p style="margin:0px"><font size="1">outputarray.SetValue(0, Theta)</font></p>
<p style="margin:0px"><font size="1">output.GetRowData().AddArray(outputarray)</font></p><p style="margin:0px"><font size="1"><br></font></p><p style="margin:0px">I&#39;m not even sure what to use as the output data set type.  In the end I need to plot (or export as a table) the value of &quot;Theta&quot; across all my time steps.  Any guidance would be appreciated.</p>

<span class="HOEnZb"><font color="#888888">
<p style="margin:0px"><br></p><p style="margin:0px">-Scott</p></font></span></div>
<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></div>