Hello,

I wrote a python script to integrate a quantity defined in a calculator. I'd
like to perform the computation for all time steps,
but I  just have zero values for all time steps after the first one.
Someone would know it?
This is my try:

#!/cluster/apps/paraview/bin/pvpython
try: paraview.simple
except: from paraview.simple import *

casefile = '/home/piccinini/work/sygma_head/v02/movel/paraview/SYG2.CASE'

CASE = EnSightReader( CaseFileName=casefile )   #Read ENSI case
CASE.CellArrays = ['SVEL', 'P', 'PTER', 'TE', 'ED', 'T']
tsteps = CASE.TimestepValues                    #Get timesteps
print len(tsteps)
Show()

PointData = CellDatatoPointData(PassCellData=1)                #Convert to
cell data

valveCurtain = Slice( SliceType="Plane" )
valveCurtain.SliceType.Origin = [0, 0, 0.015]
valveCurtain.SliceType.Normal = [0.0, 0.0, 1.0]

LzF = Calculator()
LzF.AttributeMode = 'point_data'
LzF.Function = '(coordsX*SVEL_Y-coordsY*SVEL_X)*SVEL_Z'
LzF.ResultArrayName = 'LzF'

for t in tsteps:
    print 'Time (s) = ',t
    RV1 = GetRenderView()
    RV1.ViewTime = t

    RV1.CameraViewUp = [0.0, 0.0, 1.0]
    RV1.CameraPosition = [-0.080070000141859055, -1.1188103732684673,
0.027209000661969185]
    RV1.CameraFocalPoint = [-0.080070000141859055, -0.078404996544122696,
0.027209000661969185]
    RV1.CameraClippingRange = [0.74661537378502163, 1.4127359813330285]


    Render()
    Show()

    valveCurtainIntegral = IntegrateVariables()
    data = servermanager.Fetch(valveCurtainIntegral,0)
    scalarData = data.GetPointData()
    avgVar = scalarData.GetArray(0).GetTuple1(0)

    print 'Integral value = ', avgVar


--
Rodrigo
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview

Reply via email to