Lost atoms when calling write_data after successful NVT

Dear LAMMPS users/devs

I’m simulating a coarse-grained graphene sheet, which is an hexagonal lattice with bonds crossing the box boundaries.

I can minimize with box/relax a 10x10 superlattice, and equilibrate it with NVT at 4K without issue.

When I try to write_data after the NVT run, i get the following error:

WARNING: Proc sub-domain size < neighbor skin, could lead to lost atoms (src/src/domain.cpp:963)
ERROR: Atom count is inconsistent, cannot write data file (src/src/write_data.cpp:150)

If I omit write_data and try to run an NPT equilibration, I get a Fix npt/nph has tilted box too far in one step error.

Using write_dump to dump a xyz file after the NPT works fine and results in a file with the correct amount of atoms.

My question is: how can the atoms be lost after a successful NVT run? How can I prevent this?

The input and log files are in the following gist: LAMMPS periodic hexagonal sheet · GitHub

Thanks!

The problem is due to having a fixed boundary and atoms not moving much and thus not triggering a neighbor list rebuild. Atoms may leave the assigned subdomains (or the entire simulation box) in between neighbor list updates. But they are not “lost” until the atoms are redistributed and communicated into their subdomains again. This is done during a neighbor list rebuild or as part of the write_data command (or write_restart etc.). Changing your box to “p p m” avoids this issue.

The second issue is due to the fix npt settings and a large off-diagonal pressure. I suggest trying with a much larger time constant.

You have some very unusual settings that can cause problems (apart from the very asymmetric box dimensions). Your communication cutoff could be much smaller (say half due to your rather long bonds) and that is even more true for the neighbor list skin (a value of 2.0 should suffice).

Thank you for the (very!) quick response!

Using boundary p p m solved the losing atom issue. I misread the documentation and didn’t see that I was fixing the lower z boundary.

I has tried enlarging the comm cutoff and the NL skin exactly because I was afraid that atoms would have zero neighbors and be easier to lose, due to errors like

WARNING: Communication cutoff 75 is shorter than a bond length based estimate of 78.875. This may lead to errors.

Since my atoms won’t move too much, can I safely ignore this?

Setting the temperature time constant to 100 steps and the pressure time constant to 10000steps solved the stability issues, 1000 steps wasn’t enough, though.

LAMMPS issues solved, now to deal with the physics.

Thanks, Axel!