Unexpected behavior with "atom/swap"

Dear LAMMPS users,

I’m facing strange behavior with a simulation that includes a Monte Carlo fix to swap atoms’ chemical species. I looked carefully both in the manual and in the mailing list archive to see whether a similar thing had been already discussed.

In brief, if I continue the simulation from a restart file and I use the same fix-ID for the MC, then the simulation runs as if no MC were present: in the log file, the values of attempted/accepted moves are just zeros. However, if I change the fix-ID or restart from a data file, everything works as expected.

At the following link, there is a small working example: https://drive.google.com/file/d/1z-hEmmO_Du5_VGci1yAqtln0-XL3-ZOx/view?usp=sharing.
I’m using LAMMPS patched as of 29 March 2019.

Any help would be appreciated. I hope I’m not missing something obvious or I didn’t understand that this is somehow a wanted behavior of this fix.

Best,

what happens, if you remove the “reset_timestep 0” line?

the fix stores in the restart file at what time step to do the next reneighboring during which process the swaps are attempted (as part of the Fix::pre_exchange() hook).
with reset_timestep you start the timestep counter from 0 and it may take a while until the fix reaches the value of next_reneighbor that is stored in the restart.

axel.

Well, thanks a lot for the help, Axel. That was the problem. Now it’s a bit more clear what’s happening behind the scenes of that fix.

Thanks.

FWIW, with the next LAMMPS patch there will be a small upgrade to the restart capability of fix atom/swap. it will include a test for the timestep and also store the number of swap attempts and successful swaps, so the restarting should be more seamless and avoid this specific scenario.

axel.