Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions calphy/integrators.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def integrate_rs(

Notes
-----
Writes the output in a file reversible_scaling.dat
Writes the output in a file temperature_sweep.dat and temperature_sweep.npz

"""
ws = []
Expand Down Expand Up @@ -269,6 +269,8 @@ def integrate_rs(
if not return_values:
outfile = os.path.join(simfolder, "temperature_sweep.dat")
np.savetxt(outfile, np.column_stack((temp, f, werr)))
outfile = os.path.join(simfolder, "temperature_sweep.npz")
np.savez_compressed(outfile, (temp, f, werr))
return None, e_diss
else:
return (temp, f, werr), e_diss
Expand All @@ -293,7 +295,7 @@ def integrate_ps(simfolder, f0, natoms, pi, pf, nsims=1, return_values=False):

Notes
-----
Writes the output in a file pressure_sweep.dat
Writes the output in a file pressure_sweep.dat and pressure_sweep.npz

"""

Expand Down Expand Up @@ -329,6 +331,8 @@ def integrate_ps(simfolder, f0, natoms, pi, pf, nsims=1, return_values=False):
if not return_values:
outfile = os.path.join(simfolder, "pressure_sweep.dat")
np.savetxt(outfile, np.column_stack((press, f, werr)))
outfile = os.path.join(simfolder, "pressure_sweep.npz")
np.savez_compressed(outfile, (press, f, werr))
else:
return (press, f, werr)

Expand Down
11 changes: 11 additions & 0 deletions calphy/phase.py
Original file line number Diff line number Diff line change
Expand Up @@ -917,6 +917,17 @@ def submit_report(self, extra_dict=None):
self.publications.append("10.1016/j.commatsci.2018.12.029")
self.publications.append("10.1063/1.4967775")

def submit_ts_report(self):
datafile = os.path.join(self.simfolder, "temperature_sweep.npz")
T, f, ferr = np.load(datafile).values()
report = {}
report["results"] = {}
report["temperature"] = T
report["free_energy"] = f
reportfile = os.path.join(self.simfolder, "report_ts.yaml")
with open(reportfile, "w") as f:
yaml.dump(report, f)

def reversible_scaling(self, iteration=1):
"""
Perform reversible scaling calculation in NPT
Expand Down
1 change: 1 addition & 0 deletions calphy/routines.py
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,7 @@ def routine_ts(job):
job.logger.info("TS integration cycle %d finished in %f s" % (i + 1, te))

job.integrate_reversible_scaling(scale_energy=True)
job.submit_ts_report()
job.clean_up()
return job

Expand Down
Loading