Animate relative change

Hi, I have a set of model outputs contained in .vtu and .pvtu files. There are a time series of n files. I would like to visualise the relative change over time for a given field (i.e. something like FieldName_(t+1) - FieldName_(t)), so this would result in a time series of length t-1. I don’t need to save this data to file, I just want to be able to visualise it within Paraview, and perhaps save an animation of it.

Perhaps I need to write a python script for this because I don’t think there is a filter that will do it? I have some experience using python, but I know very little about the Paraview python structures and how to use them.

I see that the TemporalArrayOperator can easily provide a difference plot from 2 specific timesteps. I can figure out the specific commands used by using the python trace. I think I can acecss the number of timesteps using python, and I think I could easily write a python loop to apply TemporalArrayOperator as I need it to be used.

But I don’t know how to get the output of this into some kind of time evolving field object. I can’t see how to do anything other than create t-1 different instances of the TemporalArrayOperator, which isn’t really what I am after!

I am currently using Paraview 5.10.0 on a Linux (Ubuntu) virtual machine under a Windows host OS.

Thanks!
Rupert

Hi @Rupert_Gladstone

TemporalShift + PythonCalculator should do the trick

Best,

Thanks for the quick reply.

When I try this approach I get a viable difference popping up (i.e. it looks plausible and isn’t zero), but when I try to play forward it resets to zero everywhere. And when I chose the timestep at which I first got a viable difference it is back to zero. I guess something is getting confused internally regarding time.

Note that I just did this simple difference in the python calculator (was I supposed to be active in terms of time steps? I assumed this would work given that one of the inputs has had its time shifted):
inputs[0].PointData[‘water pressure’]-inputs[1].PointData[‘water pressure’]

I’ve tried with different settings for pre shift and post shift but always the same result: whenever I move forward or back in time it resets to zero. I first thought post shift = 1 would be what was needed. But I tried different non zero values for both pre and post shift in case I misunderstood.

I just installed 5.11 on my windows system and I get the same issue.

For now I am using the force time filter and the python calculator, so I’m getting a change relative to a fixed point in time, which is probably sufficient for my current analyses. I’d be curious to know if I am doing something wrong or if there is some kind of bug here.

Thanks,
Rupert

This looks fine to me, please share data and a state file.

Will do after lunch!

Hi Mathieu, the files were quite large so I made a much reduced version that reproduces the problem. But it is stil too large for the 4MB limit here. Can you access it from my google drive or do you need me to make it less than 4MB?

https://drive.google.com/file/d/1hGmwxWlGkppA_jwks9pzfMjvMmfdJ1io/view?usp=sharing

Thanks!
Rupert

There is definitely a bug somewhere, probably in TemporalShift, that causes the behavior to be inconsistent, could you open an issue: https://gitlab.kitware.com/paraview/paraview/-/issues ?

Merci Mathieu.

I created an issue here

Hope this is ok.

1 Like