I’m running a simulation for which I would like to dynamically exclude some atoms from the neighbour list building. It semms that when using a dynamic group the neig_modify command simply ignores it. I found another issue where this problem was commented but no solution was provided for this particular issue.
neigh_modify works perfectly fine with static groups and I checked that my dynamic groups are not empty
Example:
region ss sphere 50 50 50 100
group mobile_static region ss
group mobile_dynamic dynamic all region ss every 1
neigh_modify every 1 exclude group mobile_dynamic
The command excludes properly for static but not for dynamic
From looking at the source code that updates the group bitmasks for atoms, I can see that there could be an issue using dynamic groups for neighbor lists, since they are updated after the neighbor list build.
I can confirm that. We are looking into what would be a proper solution for this, but for the time being the only path would be to throw and error when dynamics groups are used for neighbor list exclusions.
I’ve recently used this combination (neigh_modify exclude with a dynamic group) in some simulations I’ve run, and it seemed to behave as expected in my case (I was using the LAMMPS stable release of 02/08/2023).
If you remember what was the problem in your case, could you please share some more details?
I also see that in the current LAMMPS stable release (22/07/2025) the problem seems to be still not solved.