This program visualizes a tree based gravity solver. Several hundred particles in a box with periodic boundary conditions are simulated and displayed in real time on your iPhone. Exactly the same simulation also runs on supercomputing facilities. It can be used to model the formation of planetesimals. Planetesimals are the building blocks of planets in the early solar system. Because of self-gravity planetesimals clump and eventually form planets. However, to model the physical processes realistically, one has to use many more particles than the iPhone can handle (hundreds of thousands).
The original idea of a tree code is based on a nature paper by J. Barnes and P. Hut (Nature, 324(4):446-449, December 1986). A recent scientific publication describing some details of this particular code is available for free at http://arxiv.org/abs/1001.0109