I am using LAMMPS version 2 Aug 2023 - Update 2. I use the “fix rigid” command to simulate CO2 with the TraPPE model. However, when I write two “run” commands at the beginning of the second run or use the data file output as another simulation input, I sometimes encounter the following error:
ERROR on proc 0: Atoms have moved too far apart (734.0632310066682) for minimum image (src/domain.cpp:994).
What should be done to solve this error? Is this a software bug? I also tested with the version (7 Feb 2024 version) and got the same results.
Hi all - thanks JPBergsma for posting a set of files that reproduces the problem.
The issue is that fix rigid/small is using the mimimum_image() method in the Domain
class to do an operation that used to be OK for fix rigid/small, but now isn’t b/c the minimum_image()
method was changed to avoid problems with other use cases when with bad dynamics blew atoms out of the box to be “infinitely” far away. It had the unintended side effect that it breaks fix rigid/small when you run for a long time and a rigid body crosses the periodic boundary more
than 16 times, which is the case with JPBergsma’s files.
If any of you can re-compile LAMMPS yourself, you can change this line in src/domain.cpp
static constexpr double MAXIMGCOUNT = 16;
to a larger value, e.g. 1024, then recompile and your restart script should run.
A more robust solution will require the developers to post a new PR and then merge it into the
develop branch and do a new code release (likely sometime in the next week or two).
I should clarify the issue is when a rigid body in the restart file is 16+ box lengths away from its starting position, not just crossed a periodic boundary 16 times, e.g. back and forth.