Making a Time independent Variable

Hello All,

I am working on some particle tracking and I need to count the number of particle impacts I get on my mesh.

I have a programable python filter working that is able to detect if a particle hits a point on my mesh, but when I try and track the number of particle impacts over multiple time-steps I struggle as I cant define a data column output from the programable python filter that stays constant through time steps as any variable I define inside the programable python filter will not be able to be accessed in the next time step without being redefined :confused: .

If there is a way to get around this I would greatly appreciate the help :slight_smile:

You can try the PlotXXXOverTime filters. They will output a table with all times in the same dataset and then you can do some extra computation (like doing the incremental sum)

You can also use the TemporalStatistic but it will give you only the average over all timesteps, so you can recompute the cumulative sum but not the intermediate values.

If you still want to write it yourself, take a look at the vtkTemporalStatistics.cxx in vtk code source, specially RequestData method and CONTINUE_EXECUTING key. But that is the hard way if you do not know about pipeline execution and vtkInformation stuff.