add energy computing mode, add code for phantom neighbors