[lammps-users] Problems with delete_atoms command

Hi,

I have struggled with the unexpected behavior of delete_atoms command for a long time. I have narrowed down the problem to a very short script. Please see below.
I tested on the latest stable version: 29Sep2021.
mpirun -n 1 ~/Downloads/lammps-29Sep2021/src/lmp_mpi -in srp.in
The blue atoms are expected to be cut by the red particles as a plain, not end up with these stray particles.

Ethan

I think your problem results from a misinterpretation of how the algorithm in delete_atoms overlap works.
This is facilitated by using a comparatively large cutoff distance. That is not what the command was designed (and optimized) for.
The cutoff should not be larger than the effective diameter of a particle (i.e. about 1.0 sigma in this case).
If you would be using a shorter cutoff distance, delete_atoms overlap works reliably by deleting all pairs.
Problems arise when there are too many overlapping pairs including atoms from neighboring domains or across periodic boundary conditions.