Optimize the NBNxM grid for inhomogeneous systems
The NBNxM grid was chosen based on the assumpition of homogeneous particle distribution. This could lead to severe performance degradation for systems with a lot of empty space. Now this grid is optimized using an effective density.
Fixes #4805 (closed)
Edited by Berk Hess