Write particles to files