Problems of restarting from a system with "fix spring/self" and "compute msd"

Hello,

I run a simple system with two groups, top and bottom. The displacement of all atoms is limited by the “fix spring/self” command:

fix 1 all spring/self 6.7867

And I want to compute the mean square displacement of the two groups with the “compute msd” command. Everything goes as expected when I run the input file, and a restart file is saved. But when I restart from the restart file, only the group specified by “compute msd” is still limited, for example, if I compute the MSD of group top:

compute msd top msd

when I restart, atoms in group top are limited near the initial position, but atoms in group bottom move everywhere. Why does the “compute msd” command change the effect of “fix spring/self” command?

The input code:

boundary p p p
units real
atom_style full
neighbor 0.3 bin
neigh_modify delay 5
lattice fcc 3.61
region box block 0 10 0 10 -10 10
region top block 0 10 0 10 4 5
region bottom block 0 10 0 10 -5 -4
create_box 2 box
mass 1 18
mass 2 18
pair_style lj/cut 10
pair_coeff 1 1 1.376513974 2.8
pair_coeff 2 2 1.376513974 2.8
pair_coeff 1 2 0 2.8
create_atoms 1 region top
create_atoms 2 region bottom
group top region top
group bottom region bottom
velocity all create 100 87287 dist gaussian
compute msd top msd
fix 1 all spring/self 6.7867
fix 2 all nve
timestep 0.2
thermo 1000
thermo_style custom step atoms
dump 1 all custom 1000 mail.dump id type x y z
restart 1000 mail1.restart mail2.restart
run 30000

The restart input code:

read_restart mail1.restart
log 1.log.lammps
neighbor 0.3 bin
neigh_modify delay 5
region box block 0 10 0 10 -5 25
region top block 0 10 0 10 4 5
region bottom block 0 10 0 10 -5 -4
fix 1 all spring/self 6.7867
fix 2 all nve
thermo 1000
thermo_style custom step atoms
dump 1 all custom 1000 mail.1.dump id type x y z
restart 1000 mail1.1.restart mail2.1.restart
timestep 0.2
run 30000

Best regards

I cannot reproduce that with the current 23 June 2022 version of LAMMPS and the input files you post.

Please note that your “mail1.restart” file is not the latest restart file, but rather corresponds to step 29000 and not 30000 which is in “mail2.restart”. For seamless continuation it may be simpler to add a “write_restart” command at the end of an input and then use the restarts generated during the run only as a backup in case the run crashed or exceeded wall time in a batch system. To determine which restart file to use can be dealt with using shell scripting.

In general, a compute without a consumer does not do anything, and computes in general only consume data, and don’t modify it. My guess would be that there were some other changes in your input causing issues.