[Paraview] Need help with programmable filter output
Scott Ripplinger
bigbluedart at gmail.com
Thu Nov 29 23:35:38 EST 2012
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:
import math
input = self.GetInputDataObject(0,0)
output = self.GetOutputDataObject(0)
numPoints = input.GetNumberOfPoints()
points = input.GetPointData()
SurfCvg = 0
for i in xrange(numPoints):
d = points.GetArray('d').GetValue(i)
coords = input.GetPoint(i)
z = coords[2]
h = 0.00015 - abs(z - 0.00015) - 0.5*d
H0 = 2*h/d
if (H0 < 0.002):
SurfCvg = SurfCvg + 0.25*math.pi*d*d
Theta = SurfCvg/(0.01*0.001)
outputarray = vtk.vtkFloatArray()
outputarray.SetNumberOfValues(1)
outputarray.SetValue(0, Theta)
output.GetRowData().AddArray(outputarray)
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.
-Scott
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20121129/ee182e90/attachment.htm>
More information about the ParaView
mailing list