Your script worked for me for the most part with ParaView 5.3. All I did
was added a plot view to show the results (attached). If that what you were
looking for?

On Wed, Mar 29, 2017 at 12:30 PM, John Haase <[email protected]> wrote:

> They are very large. I believe you should be able to access them through
> this link
>
> https://notredame.box.com/s/qy0p9y5jg71jwxtzfey80xiq9i9udk5s
>
> Regards,
>
> John R. Haase
> [email protected]
>
> On Wed, Mar 29, 2017 at 12:06 PM, Utkarsh Ayachit <
> [email protected]> wrote:
>
>> John,
>>
>> Can you send me the datafiles too (feel free to do it off the mailing
>> list) so I can figure out what could be going wrong.
>>
>> Thanks
>> Utkarsh
>>
>> On Wed, Mar 29, 2017 at 12:01 PM, John Haase <[email protected]> wrote:
>>
>>> Hello Paraviewers,
>>>
>>> I'm trying to integrate variables over time. I found this thread where
>>> it had been brought up previously.
>>>
>>> http://paraview.markmail.org/search/?q=integral+over+time#qu
>>> ery:integral%20over%20time+page:1+mid:z75bede26onth4eu+state:results
>>>
>>> However, when I try and open the state file, paraview crashes. So what
>>> commands do I use to do the integral over time? I'm trying to integrate a
>>> PlotSelectionOverTime filter (with row data).
>>>
>>> I'm doing this programmatically, so attached is the python script. I
>>> have so far.
>>>
>>> Regards,
>>>
>>> John R. Haase
>>> [email protected]
>>>
>>> _______________________________________________
>>> 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
>>>
>>> Search the list archives at: http://markmail.org/search/?q=ParaView
>>>
>>> Follow this link to subscribe/unsubscribe:
>>> http://public.kitware.com/mailman/listinfo/paraview
>>>
>>>
>>
>
#### import the simple module from the paraview
from paraview.simple import *
import glob, re, os

def CreateCellSelection(ids):
    source = IDSelectionSource()
    source.FieldType = "CELL"
    sids = []
    for i in ids:
        sids.append(0) #proc-id
        sids.append(i) #cell-id
    source.IDs = sids
    return source

path = '/tmp/'

files = ['SteadyState_out.e', 'FinalCycle_out.e' ]
reader = []

for idx, fl in enumerate(files):
 reader.append(ExodusIIReader(FileName=path+fl))
 reader[idx].GenerateObjectIdCellArray = 1
 reader[idx].GenerateGlobalElementIdArray = 1
 reader[idx].ElementVariables = reader[idx].ElementVariables.Available
 reader[idx].PointVariables = reader[idx].PointVariables.Available
 reader[idx].ElementBlocks = reader[idx].ElementBlocks.Available

temporalShift = []

for idx, r in enumerate(reader):
 temporalShift.append(TemporalShiftScale(Input=r))
 temporalShift[idx].PreShift = -r.TimestepValues[0]

squareDiff = ProgrammableFilter(Input=temporalShift)

script = ""

for var in reader[0].ElementVariables:
 script=script + "output.CellData.append((inputs[0].CellData['" + var + "'] - inputs[1].CellData['" + var + "'])**2 , '" + var + "')\n"
squareDiff.Script=script

integrateVariables = IntegrateVariables(Input=squareDiff)

selection = CreateCellSelection(ids=[0])
integrateSqrVarOverSpace = PlotSelectionOverTime(Input=integrateVariables, Selection=selection)
integrateSqrVarOverSpace.OnlyReportSelectionStatistics = 0
integrateSqrVarOverSpace.UpdatePipeline()

Show()
ResetCamera()
Render()
raw_input()
_______________________________________________
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

Search the list archives at: http://markmail.org/search/?q=ParaView

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/paraview

Reply via email to