-
Notifications
You must be signed in to change notification settings - Fork 15
/
murnaghan_dft.py
69 lines (60 loc) · 2.2 KB
/
murnaghan_dft.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# coding: utf-8
# Copyright (c) Max-Planck-Institut für Eisenforschung GmbH - Computational Materials Design (CM) Department
# Distributed under the terms of "New BSD License", see the LICENSE file.
from __future__ import print_function
from pyiron_atomistics.atomistics.master.murnaghan import Murnaghan, MurnaghanDebyeModel
from pyiron_snippets.deprecate import deprecate
__author__ = "Joerg Neugebauer, Jan Janssen"
__copyright__ = (
"Copyright 2021, Max-Planck-Institut für Eisenforschung GmbH - "
"Computational Materials Design (CM) Department"
)
__version__ = "1.0"
__maintainer__ = "Jan Janssen"
__email__ = "janssen@mpie.de"
__status__ = "production"
__date__ = "Sep 1, 2017"
class MurnaghanDFT(Murnaghan):
@deprecate("use standard Murnaghan instead")
def __init__(self, project, job_name="murnaghan"):
super(MurnaghanDFT, self).__init__(project, job_name)
self.__version__ = "0.3.0"
def set_kpoints(
self,
mesh=None,
scheme="MP",
center_shift=None,
symmetry_reduction=True,
manual_kpoints=None,
weights=None,
reciprocal=True,
):
if self.ref_job:
self._ref_job.set_kpoints(
mesh=mesh,
scheme=scheme,
center_shift=center_shift,
symmetry_reduction=symmetry_reduction,
manual_kpoints=manual_kpoints,
weights=weights,
reciprocal=reciprocal,
)
def set_encut(self, encut):
if self.ref_job:
self._ref_job.set_encut(encut)
def get_encut(self):
if self.ref_job:
return self._ref_job.get_encut()
else:
return None
def _get_structure(self, frame=-1, wrap_atoms=True):
# base class makes sure we only get called when self.structure is set already
snapshot = self.structure.copy()
old_vol = snapshot.get_volume()
new_vol = self["output/equilibrium_volume"]
k = (new_vol / old_vol) ** (1.0 / 3.0)
new_cell = snapshot.cell * k
snapshot.set_cell(new_cell, scale_atoms=True)
if wrap_atoms:
snapshot.center_coordinates_in_unit_cell()
return snapshot