Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quasiharminic: Add additional parameters for get_thermal_properties() #109

Merged
merged 2 commits into from
Dec 7, 2023
Merged
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
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
Loading