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'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('d').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 < 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'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 "Theta" across all my time steps. Any guidance would be appreciated.</p>
<p style="margin:0px"><br></p><p style="margin:0px">-Scott</p></div>