ParticleTracer (slight reprise)

This is related to a similar thread I started a while ago (ParticleTracer, TemporalParticlesToPathlines, and state files), but is a more specific question about the expected behavior of the ParticleTracer filter.

I have successfully used the ParticleTracer to save data (the particles) over a time series, where particles are reinjected every 10 time steps, while the seed points are static. What I am attempting to do now is change the radius of the sphere used for the seed points each time new particles are injected. And this appears to be working, sort of, but not as I was expecting. I would expect that every 10th time step new particles would be added at the points on the newly sized sphere for the current time step, along with all of the previously added points at their current location at the current time step, and that there would be no need to go back and reload/recalculate anything from previous time steps.

However, at every 10th time step when new particles are injected at the new seed points, the filter appears to be going back to time step 0, and loading/calculating all of the time steps from the beginning. (I know this because my pipeline includes a programmable filter which prints out the current data time stamp value, and it prints out all values starting at 0 each time new particles are injected.)

Is this expected behavior? Is there something that I am doing wrong here?


Just wondering if anyone has any insight on this. For the data that I’m looking at it has been taking about a minute per time step to trace the particles at each step. It is at the point now that when it updates the seeds and re-injects, it takes on the order of 4 hours for that next step. With 300 steps to go, taking 4+ hours for every 10th step is not tractable. Especially if I don’t get the parameters right and need to run the whole thing multiple times.

Any advice would be appreciated.

What I am attempting to do now is change the radius of the sphere used for the seed points each time new particles are injected.

How do you achieve that ?

I’m running pvbatch, passing it a script, which includes the following…

data_00 = XDMFReader(FileNames=DATA_FILES)
seed_radius = 1000.0
sphere1 = Sphere()
sphere1.Radius = seed_radius

particleTracer1 = ParticleTracer(Input=data_00, SeedSource=sphere1)
particleTracer1.StaticSeeds = 0
particleTracer1.StaticMesh = 1
particleTracer1.ForceReinjectionEveryNSteps = 10
particleTracer1.SelectInputVectors = ['POINTS', 'vel_vector']
particleTracer1.ComputeVorticity = 0

tvals = data_00.TimestepValues
for i in range(len(tvals)):
    if (i>0) and (i % 10) == 0:
        sphere1.Radius = seed_radius

    DATA_FILE_NAME="%s/step_%04d.vtp" % (DATA_OUT_DIR, i)
    writer = CreateWriter(DATA_FILE_NAME, particleTracer1)
    del writer

I’ve left out a few details after reading the xdmf data and passing it to the ParticleTracer, but I don’t think those are relevant.

sphere1.Radius = seed_radius

Afaik, this will trigger the behavior you are seeing, as spere1 is an input of particleTracer.

You need a temporal seed source that actually increase its radius within the timesteps, you cannot do it manually inside a python script.