Skip to content

Commit

Permalink
Merge pull request #109 from pyiron/qh_thermal
Browse files Browse the repository at this point in the history
Quasiharminic: Add additional parameters for get_thermal_properties()
  • Loading branch information
jan-janssen authored Dec 7, 2023
2 parents cf6a843 + b2ac434 commit b15390c
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 6 deletions.
21 changes: 19 additions & 2 deletions atomistics/workflows/phonons/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,17 @@ def analyse_structures(self, output_dict):
self._dos_dict = self.phonopy.get_total_dos_dict()
return self._mesh_dict, self._dos_dict

def get_thermal_properties(self, t_min=1, t_max=1500, t_step=50, temperatures=None):
def get_thermal_properties(
self,
t_min=1,
t_max=1500,
t_step=50,
temperatures=None,
cutoff_frequency=None,
pretend_real=False,
band_indices=None,
is_projection=False,
):
"""
Returns thermal properties at constant volume in the given temperature range. Can only be called after job
successfully ran.
Expand All @@ -135,7 +145,14 @@ def get_thermal_properties(self, t_min=1, t_max=1500, t_step=50, temperatures=No
:class:`Thermal`: thermal properties as returned by Phonopy
"""
self.phonopy.run_thermal_properties(
t_step=t_step, t_max=t_max, t_min=t_min, temperatures=temperatures
t_step=t_step,
t_max=t_max,
t_min=t_min,
temperatures=temperatures,
cutoff_frequency=cutoff_frequency,
pretend_real=pretend_real,
band_indices=band_indices,
is_projection=is_projection,
)
tp_dict = self.phonopy.get_thermal_properties_dict()
tp_dict["free_energy"] *= kJ_mol_to_eV
Expand Down
41 changes: 37 additions & 4 deletions atomistics/workflows/quasiharmonic/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,17 @@ def analyse_structures(self, output_dict):
dos_collect_dict[strain] = dos_dict
return eng_internal_dict, mesh_collect_dict, dos_collect_dict

def get_thermal_properties(self, t_min=1, t_max=1500, t_step=50, temperatures=None):
def get_thermal_properties(
self,
t_min=1,
t_max=1500,
t_step=50,
temperatures=None,
cutoff_frequency=None,
pretend_real=False,
band_indices=None,
is_projection=False,
):
"""
Returns thermal properties at constant volume in the given temperature range. Can only be called after job
successfully ran.
Expand All @@ -90,20 +100,43 @@ def get_thermal_properties(self, t_min=1, t_max=1500, t_step=50, temperatures=No
tp_collect_dict = {}
for strain, phono in self._phonopy_dict.items():
tp_collect_dict[strain] = phono.get_thermal_properties(
t_step=t_step, t_max=t_max, t_min=t_min, temperatures=temperatures
t_step=t_step,
t_max=t_max,
t_min=t_min,
temperatures=temperatures,
cutoff_frequency=cutoff_frequency,
pretend_real=pretend_real,
band_indices=band_indices,
is_projection=is_projection,
)
return tp_collect_dict

def get_thermal_expansion(
self, output_dict, t_min=1, t_max=1500, t_step=50, temperatures=None
self,
output_dict,
t_min=1,
t_max=1500,
t_step=50,
temperatures=None,
cutoff_frequency=None,
pretend_real=False,
band_indices=None,
is_projection=False,
):
(
eng_internal_dict,
mesh_collect_dict,
dos_collect_dict,
) = self.analyse_structures(output_dict=output_dict)
tp_collect_dict = self.get_thermal_properties(
t_min=t_min, t_max=t_max, t_step=t_step, temperatures=temperatures
t_min=t_min,
t_max=t_max,
t_step=t_step,
temperatures=temperatures,
cutoff_frequency=cutoff_frequency,
pretend_real=pretend_real,
band_indices=band_indices,
is_projection=is_projection,
)

temperatures = tp_collect_dict[1.0]["temperatures"]
Expand Down

0 comments on commit b15390c

Please sign in to comment.