How to get the mean value of several simulation when fix dt/reset is used?

Dear everyone,
I faced one problem recently when I am trying to use fix dt/reset in my input file. I am trying to simulate radiation damage of material using LAMMPS. According the papers I have read, usually I should run the simulation many times, like at the same initial condition and same PKA energy but with different PKA velocities.
The problem is when fix dt/reset is used. The simulation time is different at the same timestep. Maybe it is 1ps in one simulation at timesteps 10000, but 0.9ps in another one at the same timestep. Then it is very hard to get the mean value of a certain property at the same simulation time.
I am trying to solve this by adding ‘if then’ command in my input file in order to let LAMMPS write dump file at the given simulation time. But unfortunately, my code failed to do this. The codes are shown in the following.
labal loopa
       variable a loop 1000
run 100
if “${mytime} > 0.01” then &
           “dump 1 all custom 1 dump.filename id type x y z” &
           “run 0”
           “jump SELF breaka”
next a
jump SELF loopa
label breaka
undump 1

Because I want to write data to a dump file at each given time, like at 0.01ps 0.05ps, 0.1ps, 0.2ps, … …, 1ps. I think I need to use these lines of codes as many times as the number of simulation time points I chose. But it seems the data will overwrite the former data. And also it is very hard to control the precise time when the data is written to the dump file.
Could anybody give me some help on this issue? How I can get the mean value of a certain property when fix dt/reset is used? Could you please give me a better solutions to solve my problem?
Any suggestions would be much appreciated!

With My Best Regards

We’ve discussed having an option on the dump command to dump

by simulation time (e.g. psecs) instead of timestep, which sounds

like what you want. But we havn’t added that option yet.

It should be easy to run N simulations in a loop, each

with differerent initial conditions, and have each dump a trajectory

to a different dump file. Just use a variable in the dump file name

that goes from 1 to N.

More generally, if you have some scalar property that varies over time in a single

run, and extract it from the dump or log file for the run, then

you have a curve that is property value vs time. On that curve

you should be able to interpolate a new value for any desired intermediate time.

Ditto for all the curves for the N runs. Not as accurate as having

the property computed at exactly that time, but close if you dump

snapshots often enough.


Dear Steve,

Thank you very much!

Dump by simulation time is exactly what I want. I think that would be very helpful when variable timestep is used.

And thanks very much for your suggestion about the method of interpolation.