Added the latest version of the simulation routine which measures the local
energy density