A new treecode for long-range force calculation

Abstract We propose a new hierarchical tree algorithm with high adaptivity to various particle distributions for long-range force calculations. This algorithm divides parent cells into k daughter cells using the k -means algorithm. The tree structure provided by this algorithm is independent of the coordinate system used. This method also includes a unique procedure for determining cell sizes adjusted to particle distributions. We investigated the characteristics of the tree structure and the effect on the long-range force calculation performance of various branching ratios k . The results of numerical experiments using various particle distributions showed that the number of interactions between particles and cells grows with k , but the number of distance evaluations between particles and cells decreased when k is around 5. We can therefore select an optimized value of k according to the characteristics of the problem to be analyzed. Comparing the algorithm to Barnes–Hut treecode using gravitational calculations at the same error level, we found that the calculation cost could be decreased remarkably.