Background: N-body simulation
Cosmological simulations are used to study how structure forms and evolves in the universe on size scales ranging from a few million light-years to several billion light-years. Typically, the simulations start shortly after the Big Bang and run the full lifespan of the universe, roughly 14 billion years. Simulations provide an invaluable contribution to our understanding of how the universe evolved, because the overwhelming majority of matter in the universe does not emit light and is therefore invisible to direct detection by telescopes. Furthermore, simulations represent our only way to experiment with cosmic objects such as stars, galaxies, black holes, and clusters of galaxies. For these reasons, astrophysics was among the first scientific disciplines to utilize leading-edge computational resources, a heritage that has continued to the present day.
In the simulations under discussion, the universe is represented by a set of particles. There are three varieties of particles: dark matter, gas, and stars. Some properties (e.g., position, mass, velocity) are common to all particles. Other properties (e.g., formation time, temperature, chemical content) are specific only to certain types. All particles are points in a 3D space and are simulated over a series of discrete timesteps. Every few timesteps, the simulator outputs a snapshot of the state of the simulated universe. Each snapshot records all properties of all particles at the time of the snapshot. Simulations of this type currently have between 108 - 109 particles (with approximately 100 bytes per particle) and output between a few dozen and a few hundred snapshots per run.
Check out Wikipedia for more detail.