Skip to content

Commit

Permalink
add individual contributions to report
Browse files Browse the repository at this point in the history
  • Loading branch information
srmnitc committed Oct 23, 2024
1 parent a6f1f43 commit 2c9a373
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
5 changes: 4 additions & 1 deletion calphy/integrators.py
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,8 @@ def get_einstein_crystal_fe(
calc,
vol,
k,
cm_correction=True):
cm_correction=True,
return_contributions=False):
"""
Get the free energy of einstein crystal
Expand Down Expand Up @@ -549,6 +550,8 @@ def get_einstein_crystal_fe(
F_cm = 0

F_tot = F_e - F_cm
if return_contributions:
return F_e, -F_cm
return F_tot

#--------------------------------------------------------------------
Expand Down
9 changes: 6 additions & 3 deletions calphy/solid.py
Original file line number Diff line number Diff line change
Expand Up @@ -516,17 +516,20 @@ def thermodynamic_integration(self):
Calculates the final work, energy dissipation and free energy by
matching with Einstein crystal
"""
f1 = get_einstein_crystal_fe(
fe, fcm = get_einstein_crystal_fe(
self.calc,
self.vol,
self.k)
self.k,
return_contributions=True)

w, q, qerr = find_w(self.simfolder,
self.calc,
full=True,
solid=True)

self.fref = f1
self.fref = fe + fcm
self.feinstein = fe
self.fcm = fcm
self.w = w
self.ferr = qerr

Expand Down

0 comments on commit 2c9a373

Please sign in to comment.