Improve scalability of insertion in LIGGGHTS #1
The current insertion algorithm exhibits poor scaling performance with a runtime complexity of O(n²). This is due to the fact that during each time step a utility data structure is build up to hold any particles which might collide with newly inserted particles. If a large number of particles is inserted this linear list of particles will grow accordingly. E.g. if 3 million particles are inserted, the last particle will check 2,999,999 particles for possible overlap.
To improve this situation, this PR introduces a cell list data structure around the insertion volume to replace the linear list of particles. This reduces lookup times during overlap checking.
The PR also includes a simple benchmark test case which can be used to compare the scaling of the old and the new version of the code. This test case simply inserts a specified number of particles into the domain box. The tests ranged from 10,000 - 150,000 particles. As the number of particles increases the achieved speedup of the optimized code continues to grow due to the better
The full scaling change is summarized by the following Figure. While the old code exhibits O(n²) runtime complexity, the optimized variant shows nearly linear scaling. Notice the differences in order of magnitude in the run times of the first two graphs. In the final plot both results are merged into one graph.