Added function to average density over volume of the unit cell.