Barnes-Hut N-body simulation