Massive particle simulation implementing quad- and octrees