Simulation of a many-particle system using space partitioning