[Paraview] Cut plane average velocity over time

Favre Jean jfavre at cscs.ch
Tue Feb 16 05:11:50 EST 2016


>> I would like to get an average over an entire cut plane (over time).

David

This sounds like a perfect case for a Python Programmable Filter, looping over timesteps, accumulating data, doing the average, and setting it as a new field. Here is a script I have tested on a single block of data with multiple timesteps.

There is an init phase, to get the number of timesteps, their values (from upstream), and the first dataset at the 0-th timestep.
There is an accumulate phase, where the filter pulls all timesteps, adding to the already existing numpy array.
There is a finish phase, where we do the average and assign it to a new field.

I am doing it for Pressure, you'll have to adapt it to your fieldnames and block structures.

-----------------
Jean M. Favre
Swiss National Supercomputing Center
CH-6900 Lugano
Switzerland
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/paraview/attachments/20160216/b23f2bdd/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: avg_data_over_time.py
Type: text/x-python-script
Size: 2709 bytes
Desc: avg_data_over_time.py
URL: <http://public.kitware.com/pipermail/paraview/attachments/20160216/b23f2bdd/attachment.bin>


More information about the ParaView mailing list