I’m attempting to use the ParticleTracer filter, coupled with TemporalParticlesToPathlines to trace the path of particles injected into a vector field, and show a short trail behind the particles as they move over time. And this works fine for the toy dataset I am using. However, I want to apply this to a much larger dataset and render an animation. Since the path tracing will take much more time, I will need to stop and restart the rendering (I will be using a scheduled cluster, where I can’t just run until it’s finished). I would guess I’m not the first to want to do this, so I’m wondering if there is a standard approach to doing it?
I tried saving a state file (in pvsm format), so that I can reload the state and pick up where I left off. But this doesn’t seem to work, for a number of reasons. Based on the attached images using my toy dataset, it appears that while it keeps track of the current time step that I am on, it does not keep track of the current position of the particles in the ParticleTracer, but rather recomputes them from the beginning. For these images I used a PointSource to seed the ParticleTracer, which results in different random seeds when the state is reloaded. This can be fixed by using a SphereSource to seed, but still results in the trace being recalculated on the reload.
The other issue is with the TemporalParticlesToPathlines not maintaining the state of the trails when the state was saved, but again starting over.
Is there some better way to achieve what I’m attempting to do here? Any advice would be appreciated.
Both the particle tracer and the particle pathlines filters are special in that they capture and modify geometry as they iterate over time. Thus, the save state, which just captures the state at a particular time, cannot capture this geometry or properly restore it.
For the particle tracer, you will also have to save the data of the particles the filter is generating and then load them back in as your seed points. There is no automated way of doing this; you would have to write your own script or do it by hand. For the particle pathlines, I can think of no way to do it other than to rewind time to the beginning of the path segment and run back through (or to change the filter itself to accept initial geometry).
Thanks, Ken. I was afraid that might be the case. Perhaps the best approach will be to iterate over all of the time steps once and save out the particle positions at each step, using them as seeds when I need to restart, as you suggest. Then once I have them for all steps, I can just use them as a particle data set, and create the pathlines from those. I certainly won’t get all of the rendering parameters right on the first pass. So that will enable me to explore through timesteps, without needing to recompute the particle trace every time.
As long as you’re not trying to reinject particles I think what you’re trying to do should work.
As an alternate way of doing things, you may be able to try and fiddle with the vtkInSituPParticlePathFilter. The idea here is that it separates out the seeds and particle path inputs that were computed from a previous computation (e.g. an in situ flow simulation that has been restarted). I’m not 100% sure this will work for you but you sound stuck enough that you maybe this is the best option. I wrote a blog post on this a while back that may help explain how it works:
You’ll probably need to go into the
Python Shell and create the filter since it’s not available in the
Filters menu. You can kind of see how it’s done by looking at the Catalyst example in the source code at
Examples/Catalyst/CxxParticlePathExample/SampleScripts\particlepath.py. Look for
With all that all I can really still say is good luck!
Please open your own topic.