From 2c9a3739a0aadaba4b964cd8a1c821d7d50b7e1f Mon Sep 17 00:00:00 2001 From: Sarath Menon Date: Thu, 24 Oct 2024 00:05:12 +0200 Subject: [PATCH] add individual contributions to report --- calphy/integrators.py | 5 ++++- calphy/solid.py | 9 ++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/calphy/integrators.py b/calphy/integrators.py index ae9cb66..86730a8 100644 --- a/calphy/integrators.py +++ b/calphy/integrators.py @@ -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 @@ -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 #-------------------------------------------------------------------- diff --git a/calphy/solid.py b/calphy/solid.py index 053a143..3f5b442 100644 --- a/calphy/solid.py +++ b/calphy/solid.py @@ -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