Well, this problem is, as the error message suggests, about having too many bins. That number is larger than max
unsigned int. You could recompile after changing
binID type to
size_t, but I won't recommend that. You should make your simulation world smaller (you probably have unused space anyway) or make the bins larger or make sure the spheres do not overlap each other too much.
You should first make sure your simulation did not crash because of divergence (huge particle velocity). If you use the newest version of DEME, the code should give you an overview of the simulation system when it crashes due to too many spheres in a bin, and that should give you an idea of whether the simulation destabilized. Now if it did not crash because of that and you indeed need the bin size to be as small as 1.55 times the smallest sphere radius, then I assume it is because your custom force model would naturally induce large sphere penetrations. This is a difficult situation as you can imagine, since the number of contacts a sphere has gets big if large penetration is allowed. Right now, you have to make do with what the code has.
My suggestion is: first, you should remove that DEMSim.SetExpandSafetyMultiplier(2.1) line, or at least use something smaller, like 1.1. I don't think your simulation needs the safety ensured by such a larger contact margin. Then you can try to make your simulation world smaller. Just do not create a world larger than your need. I suspect these treatments will just fix the problem.
I may post an update that lets the code automatically ditch the idea of using shared memory to avoid this problem, when a bin has too many spheres, at some point. But before that, we have to smartly evade the too-many-spheres problem.
Thank you,
Ruochun