[lammps-users] Compute displace/atom

Dear Lammps users,

  I am having trouble in using the "compute displace/atom" command. I need
to use this command instead of "compute msd" because of the formulas I
evaluate. A strange thing happens when I use displace/atom after a
previous run in the same script.

In my script, I have:

.
.
.
run 2000
.
.
.
run 500

compute displace all displace/atom

compute dLi Li reduce ave c_displace[4]
.
.
.
thermo_style custom step temp pe etotal press &
    v_msdLi v_FsLi v_ngpLi c_dLi

run 5000

The output is:

Step Temp PotEng TotEng Press msdLi FsLi ngpLi dLi
    2500 1303.6736 -135361.48 -133808.63 -3612.6587 2323.4818
-0.85809684 -0.096419265 41.86742
    2510 1285.3588 -135367.18 -133836.14 -3104.6632 2323.7993
-0.81168202 -0.096068681 41.868573
    2520 1306.9944 -135386.69 -133829.88 -2825.3143 2322.8306
-0.74960054 -0.10368717 41.867775
    2530 1295.8183 -135393.62 -133850.12 -1723.3871 2322.8236
-0.71062101 -0.10399987 41.86948
    2540 1283.8128 -135393.51 -133864.31 -3933.8362 2333.5018
-0.68022413 -0.098558386 41.870724

Should the "dLi" value be zero at 2500 instead of 41.86742?? Conversely,
if I remove the previous runs, the displacement is zero as expected.

I am using the 5-jun version of lammps and this problem was absent in the
15-jan version. What could be the problem??

  Thanks for your help!

  Luis

If I add these lines:

compute displace all displace/atom
compute dLi all reduce ave c_displace[4]
thermo_style custom step temp pe etotal press c_dLi
run 100

to the end of bench/in.lj, I do not see this behavior.
The c_dLi value is 0 on the first subsequent timestep
as expected.

Steve