Hello,<br><br>I wrote a python script to integrate a quantity defined in a calculator. I'd like to perform the computation for all time steps, <br>but I just have zero values for all time steps after the first one. Someone would know it?<br>
This is my try:<br><br>#!/cluster/apps/paraview/bin/pvpython<br>try: paraview.simple<br>except: from paraview.simple import *<br><br>casefile = '/home/piccinini/work/sygma_head/v02/movel/paraview/SYG2.CASE'<br><br>
CASE = EnSightReader( CaseFileName=casefile ) #Read ENSI case<br>CASE.CellArrays = ['SVEL', 'P', 'PTER', 'TE', 'ED', 'T']<br>tsteps = CASE.TimestepValues #Get timesteps<br>
print len(tsteps)<br>Show()<br><br>PointData = CellDatatoPointData(PassCellData=1) #Convert to cell data<br><br>valveCurtain = Slice( SliceType="Plane" )<br>valveCurtain.SliceType.Origin = [0, 0, 0.015]<br>
valveCurtain.SliceType.Normal = [0.0, 0.0, 1.0]<br><br>LzF = Calculator()<br>LzF.AttributeMode = 'point_data'<br>LzF.Function = '(coordsX*SVEL_Y-coordsY*SVEL_X)*SVEL_Z'<br>LzF.ResultArrayName = 'LzF'<br>
<br>for t in tsteps:<br> print 'Time (s) = ',t<br> RV1 = GetRenderView()<br> RV1.ViewTime = t<br> <br> RV1.CameraViewUp = [0.0, 0.0, 1.0]<br> RV1.CameraPosition = [-0.080070000141859055, -1.1188103732684673, 0.027209000661969185]<br>
RV1.CameraFocalPoint = [-0.080070000141859055, -0.078404996544122696, 0.027209000661969185]<br> RV1.CameraClippingRange = [0.74661537378502163, 1.4127359813330285]<br><br> <br> Render()<br> Show()<br> <br>
valveCurtainIntegral = IntegrateVariables()<br> data = servermanager.Fetch(valveCurtainIntegral,0)<br> scalarData = data.GetPointData()<br> avgVar = scalarData.GetArray(0).GetTuple1(0)<br> <br> print 'Integral value = ', avgVar<br>
<br><br>--<br>Rodrigo<br>