compute msd + fix ave/time
compute msd: http://lammps.sandia.gov/doc/compute_msd.html
This compute calculates a global vector of length 4, which can be accessed by indices 1-4 by any command that uses global vector values from a compute as input. See this section for an overview of LAMMPS output options.