Should work for an arbitrary number of particles (not only multiples of
256) - mirrored latest change from Andrey on the C++ version:
https://github.com/openworm/Smoothed-Particle-Hydrodynamics/commit/86d187eacaf5cacb1c5da97fa2f230ff3e5126c5