I am currently implementing a n-body-simulation (gravity/3D) for big n (depending on how things go > 1Mio. particles) and am wondering, what integration-method to use. I guess it should have variable step-size to minimize errors.
I'm using the barnes-hut-algorithm and boost/odeint, but will probably write my own integrator to reduce overhead (which boost probably has because it's general purpose). I'm not sure yet, if I will use other methods than barnes-hut to improve performance further.
Since the evaluation of an ODE-function with that many particles is very expensive, I guess an integrator that uses as little function-evaluations as possible would be best. But I couldn't find any good information about integrators (especially for n-body-simulations with big n). Performance would be more important to me than accuracy (as long as accuracy is reasonabe).
So can anybody tell me what would be a good integrator for this type of problem? Right now I'm using runge-kutta dormand-prince (4/5th order) and sometimes switch to fehlberg (7/8)...