[lammps-users] resolving error: Cannot use neighbor bins - box size << cutoff


I have been trying to run a 2D granular impact simulation with periodic boundary conditions on either side but I keep getting an error which I don’t quite understand.
I’ve included a schematic of my desired setup below and the simulation happens in the x-y plane. Since I am using a custom potential for the walls, I assumed the walls to be very large granules (diameter of wall about 1e+5>>diameter of granules 1e-2) instead of using a piston. My goal is to apply a periodic boundary condition in the x (horizontal) direction of the domain of the black box shown below. I would like the granules exiting the left or right of it to be mapped to the other side.

Since the width of the granular domain (red box) is 0.25, I used a simulation box with dimensions:
0.0 0.25 xlo xhi
-1.1000000000000000e+05 1.1000000000000000e+05 ylo yhi
-1.0000000000000000e+02 1.0000000000000000e+02 zlo zhi

and for the boundary I used:
boundary pp ff pp

as I am controlling the displacement of the walls. The cutoff I use is about 5 times the diameter of my granules.

I do not understand why I would get an error saying box size << cutoff. I appreciate any help I can get to alleviate this issue.


It is impossible to provide meaningful advice without having a simple but fully functional input deck that reproduces this issue and the matching output.

The error message is quite clear. You must not have periodic boundaries with an interaction cutoff vastly larger than the box dimensions.
You have ridiculously asymmetric box dimensions. That is not likely to work to produce meaningful results.

Hi Axel,

Thanks for your response. I’ve attached my input script with the typical Hertzian potential available in LAMMPS. I tried changing the values for the cutoff but to no avail. Typically how large must the box be than the cutoff for it to work?

Would the asymmetric box give me erroneous data even though the majority of the space is occupied by the ridiculously large wall granules?


in_vel_l_0.0055_vel_r_0.0055_time_500000.spheres1 (2.67 KB)

data_equilibration_0.25_4.spheres (345 KB)

in conventional MD codes, the cutoff may not exceed half the length of a (periodic) box in any direction.
LAMMPS does not have that limitation, but once you have a cutoff that is multiple times the box dimension you run into all kinds of problems.
all kinds of binning operations become either very inefficient or need to use too many bins (so they’ll overflow the array indices).
neighborlist construction also suffers from similar problems and you have to create many, many useless ghost atoms because lammps needs to compute their interactions (that is what the pair style requires).

in other words, those crazy large particles blow up your cutoff and mess everything up.

from the output:

Neighbor list info …
update every 1 steps, delay 0 steps, check yes
max neighbors/atom: 2000, page size: 100000
master list distance cutoff = 200000
ghost atom cutoff = 200000

for granular particles the cutoff is primarily determined by the diameter of particles.
you can work around the immediate crash by using the (much) slower “nsq” neighbor list construction scheme,
but that will slow down your calculation by several orders of magnitude, which will get worse with larger systems.
and that is with brutal hacks to just make the simulation continue that are not likely to give meaningful results.

i cannot think of a fitting adjective or simile describing the utility of your model.
you need a “real” wall potential or try to build a wall from many small particles.


1 Like