Save data to python array from Integrate Variables filter

python

(Niki C) #1

Hi all!

I’m trying to create a synthetic streak tool that will use scalar outputs ‘A’ and ‘B’ from simulation data to get an integrated value over the quantity ‘C’. I do this by first creating a calculator to multiply the ‘A’ and ‘B’ data, creating a ‘C’ result, then using a PlotOverLine filter across the simulation domain, then integrating the data using the IntegrateVariables filter. This produces a single integrated value for C. I want to do this for multiple PlotOverLine filters (lets say N_plot) and store each integrated value to a python array. I then want to do this for every time step in the simulation (N_timesteps), and finally store this in a [N_timesteps x N_points] array.

I’ve added my current script, which works fine, however is incredibly slow, considering N_timesteps and N_points are actually 400 each. It appears that the only way to update all sources and filters with the current timestep data is by using “Show(integrateVariables1)” every time a new integration is performed (refer to attached script), which slows the process considerably. Using UpdatePipeline() doesn’t seem to update the source, and only returns the original timestep value. Can anyone spot a more efficient way of doing this?

Many thanks!

paraview_synthetic_streak.py (1.8 KB)