Skip to content

Commit

Permalink
refactoring for extrap bugfix
Browse files Browse the repository at this point in the history
  • Loading branch information
eimrek committed Jan 11, 2018
1 parent 7ed232c commit 3f708f6
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions scripts/cp2k-extrapolate.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,11 @@
args.height, verbose=True)
np.savetxt(hartree_planefile, hartree_plane)

hartree_avg = np.mean(hartree_plane) / eV2Ha
hartree_min = np.min(hartree_plane) / eV2Ha
hartree_max = np.max(hartree_plane) / eV2Ha
hartree_plane /= eV2Ha

hartree_avg = np.mean(hartree_plane)
hartree_min = np.min(hartree_plane)
hartree_max = np.max(hartree_plane)
print("Hartree potential on extrapolation surface:")
print(" min {:+.4f} eV, max {:+4f} eV, avg {:+.4f} eV" \
.format(hartree_min, hartree_max, hartree_avg))
Expand Down Expand Up @@ -138,8 +140,8 @@
weighted_hartree = hartree_plane * density_plane
weighted_hartree_avg = np.sum(weighted_hartree)
print("Weighted average of Hartree potential: {:+.4f} eV" \
.format(weighted_hartree_avg/eV2Ha))
hartree = weighted_hartree_avg/eV2Ha
.format(weighted_hartree_avg))
hartree = weighted_hartree_avg

# Note: Working in Hartree atomic units here
E = (cube.energy - hartree) * eV2Ha * np.dot(cube.dz, cube.dz) / a02A**2
Expand Down Expand Up @@ -195,4 +197,3 @@

print("")
print("Job done.")

0 comments on commit 3f708f6

Please sign in to comment.