Skip to content

Commit ffcccff

Browse files
committed
add names to jobs
1 parent 52bdb1c commit ffcccff

File tree

9 files changed

+398
-58754
lines changed

9 files changed

+398
-58754
lines changed

src/atomate2/common/flows/gruneisen.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ def make(self, structure: Structure) -> Flow:
117117
const_vol_struct_plus = self.const_vol_relax_maker.make(
118118
structure=struct_dict.output["plus"]
119119
)
120+
const_vol_struct_plus.append_name(" plus")
120121
# add relax job at constant volume for expanded structure
121122
jobs.append(const_vol_struct_plus)
122123

@@ -128,6 +129,7 @@ def make(self, structure: Structure) -> Flow:
128129
const_vol_struct_minus = self.const_vol_relax_maker.make(
129130
structure=struct_dict.output["minus"]
130131
)
132+
const_vol_struct_minus.append_name(" minus")
131133
# add relax job at constant volume for shrunk structure
132134
jobs.append(const_vol_struct_minus)
133135

@@ -140,7 +142,7 @@ def make(self, structure: Structure) -> Flow:
140142
for st in opt_struct:
141143
# phonon run for all 3 optimized structures (ground state, expanded, shrunk)
142144
phonon_job = self.phonon_maker.make(structure=opt_struct[st])
143-
145+
phonon_job.append_name(f" {st}")
144146
# change default phonopy.yaml file name to ensure workflow can be
145147
# run without having to create folders, thus
146148
# prevent overwriting and easier to identify yaml file belong

src/atomate2/vasp/flows/gruneisen.py

Lines changed: 94 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,94 @@
1+
"""Flows for calculating Grueneisen-Parameters."""
2+
3+
from __future__ import annotations
4+
5+
from dataclasses import dataclass, field
6+
from typing import TYPE_CHECKING
7+
8+
from atomate2.common.flows.gruneisen import BaseGruneisenMaker
9+
from atomate2.vasp.flows.phonons import PhononMaker
10+
from atomate2.vasp.jobs.core import StaticMaker, TightRelaxMaker
11+
from atomate2.vasp.flows.core import DoubleRelaxMaker
12+
from atomate2.vasp.sets.core import TightRelaxSetGenerator
13+
14+
if TYPE_CHECKING:
15+
from atomate2.common.flows.phonons import BasePhononMaker
16+
17+
18+
@dataclass
19+
class GruneisenMaker(BaseGruneisenMaker):
20+
"""
21+
Maker to calculate Grueneisen parameters with a force field and Phonopy.
22+
23+
Calculate the harmonic phonons of a material for and compute Grueneisen parameters.
24+
Initially, a tight structural relaxation is performed to obtain a structure without
25+
forces on the atoms. The optimized structure (ground state) is further expanded and
26+
shrunk by 1 % of its volume. Subsequently, supercells with one displaced atom are
27+
generated for all the three structures (ground state, expanded and shrunk volume)
28+
and accurate forces are computed for these structures. With the help of phonopy,
29+
these forces are then converted into a dynamical matrix. This dynamical matrix of
30+
three structures is then used as input phonopy Grueneisen api to compute Grueneisen
31+
parameters are computed.
32+
33+
34+
Parameters
35+
----------
36+
name : str
37+
Name of the flows produced by this maker.
38+
bulk_relax_maker: .ForceFieldRelaxMaker, .BaseAimsMaker, .BaseVaspMaker, or None
39+
A maker to perform an initial tight relaxation on the bulk.
40+
code: str
41+
determines the dft or force field code.
42+
const_vol_relax_maker: .ForceFieldRelaxMaker, .BaseAimsMaker,
43+
.BaseVaspMaker, or None. A maker to perform a tight relaxation
44+
on the expanded and shrunk structures at constant volume.
45+
kpath_scheme: str
46+
scheme to generate kpoints. Please be aware that
47+
you can only use seekpath with any kind of cell
48+
Otherwise, please use the standard primitive structure
49+
Available schemes are:
50+
"seekpath", "hinuma", "setyawan_curtarolo", "latimer_munro".
51+
"seekpath" and "hinuma" are the same definition but
52+
seekpath can be used with any kind of unit cell as
53+
it relies on phonopy to handle the relationship
54+
to the primitive cell and not pymatgen
55+
mesh: tuple
56+
Mesh numbers along a, b, c axes used for Grueneisen parameter computation.
57+
phonon_maker: .PhononMaker
58+
Maker used to perform phonon computations
59+
perc_vol: float
60+
Percent volume to shrink and expand ground state structure
61+
compute_gruneisen_param_kwargs: dict
62+
Keyword arguments passed to :obj:`compute_gruneisen_param`.
63+
"""
64+
65+
name: str = "Gruneisen"
66+
bulk_relax_maker: TightRelaxMaker | None = field(default_factory=lambda: DoubleRelaxMaker.from_relax_maker(TightRelaxMaker()))
67+
code: str = "vasp"
68+
# TODO: double relax maker?
69+
70+
const_vol_relax_maker: TightRelaxMaker | None = field(
71+
default_factory=lambda: TightRelaxMaker(
72+
input_set_generator=TightRelaxSetGenerator(
73+
user_incar_settings={"ISIF": 2},
74+
)))
75+
kpath_scheme: str = "seekpath"
76+
phonon_maker: BasePhononMaker = field(
77+
default_factory=lambda: PhononMaker(bulk_relax_maker=None)
78+
)
79+
perc_vol: float = 0.01
80+
mesh: tuple = field(default_factory=lambda: (20, 20, 20))
81+
compute_gruneisen_param_kwargs: dict = field(default_factory=dict)
82+
symprec: float = 1e-4
83+
84+
@property
85+
def prev_calc_dir_argname(self) -> None:
86+
"""Name of argument informing static maker of previous calculation directory.
87+
88+
As this differs between different DFT codes (e.g., VASP, CP2K), it
89+
has been left as a property to be implemented by the inheriting class.
90+
91+
Note: this is only applicable if a relax_maker is specified; i.e., two
92+
calculations are performed for each ordering (relax -> static)
93+
"""
94+
return

tests/conftest.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ def si_structure(test_dir):
9797
return Structure.from_file(test_dir / "structures" / "Si.cif")
9898

9999

100+
@pytest.fixture()
101+
def si_diamond(test_dir):
102+
return Structure.from_file(test_dir / "structures" / "Si_diamond.cif")
103+
104+
100105
@pytest.fixture()
101106
def sr_ti_o3_structure(test_dir):
102107
return Structure.from_file(test_dir / "structures" / "SrTiO3.cif")
Lines changed: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
1+
# generated using pymatgen
2+
data_Si
3+
_symmetry_space_group_name_H-M Fd-3m
4+
_cell_length_a 5.44370237
5+
_cell_length_b 5.44370237
6+
_cell_length_c 5.44370237
7+
_cell_angle_alpha 90.00000000
8+
_cell_angle_beta 90.00000000
9+
_cell_angle_gamma 90.00000000
10+
_symmetry_Int_Tables_number 227
11+
_chemical_formula_structural Si
12+
_chemical_formula_sum Si8
13+
_cell_volume 161.31810739
14+
_cell_formula_units_Z 8
15+
loop_
16+
_symmetry_equiv_pos_site_id
17+
_symmetry_equiv_pos_as_xyz
18+
1 'x, y, z'
19+
2 '-y+1/4, x+1/4, z+1/4'
20+
3 '-x, -y+1/2, z+1/2'
21+
4 'y+3/4, -x+1/4, z+3/4'
22+
5 'x, -y, -z'
23+
6 '-y+1/4, -x+3/4, -z+3/4'
24+
7 '-x, y+1/2, -z+1/2'
25+
8 'y+3/4, x+3/4, -z+1/4'
26+
9 'z, x, y'
27+
10 'z+1/4, -y+1/4, x+1/4'
28+
11 'z+1/2, -x, -y+1/2'
29+
12 'z+3/4, y+3/4, -x+1/4'
30+
13 '-z, x, -y'
31+
14 '-z+3/4, -y+1/4, -x+3/4'
32+
15 '-z+1/2, -x, y+1/2'
33+
16 '-z+1/4, y+3/4, x+3/4'
34+
17 'y, z, x'
35+
18 'x+1/4, z+1/4, -y+1/4'
36+
19 '-y+1/2, z+1/2, -x'
37+
20 '-x+1/4, z+3/4, y+3/4'
38+
21 '-y, -z, x'
39+
22 '-x+3/4, -z+3/4, -y+1/4'
40+
23 'y+1/2, -z+1/2, -x'
41+
24 'x+3/4, -z+1/4, y+3/4'
42+
25 '-x+1/4, -y+1/4, -z+1/4'
43+
26 'y, -x, -z'
44+
27 'x+1/4, y+3/4, -z+3/4'
45+
28 '-y+1/2, x, -z+1/2'
46+
29 '-x+1/4, y+1/4, z+1/4'
47+
30 'y, x+1/2, z+1/2'
48+
31 'x+1/4, -y+3/4, z+3/4'
49+
32 '-y+1/2, -x+1/2, z'
50+
33 '-z+1/4, -x+1/4, -y+1/4'
51+
34 '-z, y, -x'
52+
35 '-z+3/4, x+1/4, y+3/4'
53+
36 '-z+1/2, -y+1/2, x'
54+
37 'z+1/4, -x+1/4, y+1/4'
55+
38 'z+1/2, y, x+1/2'
56+
39 'z+3/4, x+1/4, -y+3/4'
57+
40 'z, -y+1/2, -x+1/2'
58+
41 '-y+1/4, -z+1/4, -x+1/4'
59+
42 '-x, -z, y'
60+
43 'y+3/4, -z+3/4, x+1/4'
61+
44 'x, -z+1/2, -y+1/2'
62+
45 'y+1/4, z+1/4, -x+1/4'
63+
46 'x+1/2, z+1/2, y'
64+
47 '-y+3/4, z+3/4, x+1/4'
65+
48 '-x+1/2, z, -y+1/2'
66+
49 'x+1/2, y+1/2, z'
67+
50 '-y+3/4, x+3/4, z+1/4'
68+
51 '-x+1/2, -y, z+1/2'
69+
52 'y+1/4, -x+3/4, z+3/4'
70+
53 'x+1/2, -y+1/2, -z'
71+
54 '-y+3/4, -x+1/4, -z+3/4'
72+
55 '-x+1/2, y, -z+1/2'
73+
56 'y+1/4, x+1/4, -z+1/4'
74+
57 'z+1/2, x+1/2, y'
75+
58 'z+3/4, -y+3/4, x+1/4'
76+
59 'z, -x+1/2, -y+1/2'
77+
60 'z+1/4, y+1/4, -x+1/4'
78+
61 '-z+1/2, x+1/2, -y'
79+
62 '-z+1/4, -y+3/4, -x+3/4'
80+
63 '-z, -x+1/2, y+1/2'
81+
64 '-z+3/4, y+1/4, x+3/4'
82+
65 'y+1/2, z+1/2, x'
83+
66 'x+3/4, z+3/4, -y+1/4'
84+
67 '-y, z, -x'
85+
68 '-x+3/4, z+1/4, y+3/4'
86+
69 '-y+1/2, -z+1/2, x'
87+
70 '-x+1/4, -z+1/4, -y+1/4'
88+
71 'y, -z, -x'
89+
72 'x+1/4, -z+3/4, y+3/4'
90+
73 '-x+3/4, -y+3/4, -z+1/4'
91+
74 'y+1/2, -x+1/2, -z'
92+
75 'x+3/4, y+1/4, -z+3/4'
93+
76 '-y, x+1/2, -z+1/2'
94+
77 '-x+3/4, y+3/4, z+1/4'
95+
78 'y+1/2, x, z+1/2'
96+
79 'x+3/4, -y+1/4, z+3/4'
97+
80 '-y, -x, z'
98+
81 '-z+3/4, -x+3/4, -y+1/4'
99+
82 '-z+1/2, y+1/2, -x'
100+
83 '-z+1/4, x+3/4, y+3/4'
101+
84 '-z, -y, x'
102+
85 'z+3/4, -x+3/4, y+1/4'
103+
86 'z, y+1/2, x+1/2'
104+
87 'z+1/4, x+3/4, -y+3/4'
105+
88 'z+1/2, -y, -x+1/2'
106+
89 '-y+3/4, -z+3/4, -x+1/4'
107+
90 '-x+1/2, -z+1/2, y'
108+
91 'y+1/4, -z+1/4, x+1/4'
109+
92 'x+1/2, -z, -y+1/2'
110+
93 'y+3/4, z+3/4, -x+1/4'
111+
94 'x, z, y'
112+
95 '-y+1/4, z+1/4, x+1/4'
113+
96 '-x, z+1/2, -y+1/2'
114+
97 'x+1/2, y, z+1/2'
115+
98 '-y+3/4, x+1/4, z+3/4'
116+
99 '-x+1/2, -y+1/2, z'
117+
100 'y+1/4, -x+1/4, z+1/4'
118+
101 'x+1/2, -y, -z+1/2'
119+
102 '-y+3/4, -x+3/4, -z+1/4'
120+
103 '-x+1/2, y+1/2, -z'
121+
104 'y+1/4, x+3/4, -z+3/4'
122+
105 'z+1/2, x, y+1/2'
123+
106 'z+3/4, -y+1/4, x+3/4'
124+
107 'z, -x, -y'
125+
108 'z+1/4, y+3/4, -x+3/4'
126+
109 '-z+1/2, x, -y+1/2'
127+
110 '-z+1/4, -y+1/4, -x+1/4'
128+
111 '-z, -x, y'
129+
112 '-z+3/4, y+3/4, x+1/4'
130+
113 'y+1/2, z, x+1/2'
131+
114 'x+3/4, z+1/4, -y+3/4'
132+
115 '-y, z+1/2, -x+1/2'
133+
116 '-x+3/4, z+3/4, y+1/4'
134+
117 '-y+1/2, -z, x+1/2'
135+
118 '-x+1/4, -z+3/4, -y+3/4'
136+
119 'y, -z+1/2, -x+1/2'
137+
120 'x+1/4, -z+1/4, y+1/4'
138+
121 '-x+3/4, -y+1/4, -z+3/4'
139+
122 'y+1/2, -x, -z+1/2'
140+
123 'x+3/4, y+3/4, -z+1/4'
141+
124 '-y, x, -z'
142+
125 '-x+3/4, y+1/4, z+3/4'
143+
126 'y+1/2, x+1/2, z'
144+
127 'x+3/4, -y+3/4, z+1/4'
145+
128 '-y, -x+1/2, z+1/2'
146+
129 '-z+3/4, -x+1/4, -y+3/4'
147+
130 '-z+1/2, y, -x+1/2'
148+
131 '-z+1/4, x+1/4, y+1/4'
149+
132 '-z, -y+1/2, x+1/2'
150+
133 'z+3/4, -x+1/4, y+3/4'
151+
134 'z, y, x'
152+
135 'z+1/4, x+1/4, -y+1/4'
153+
136 'z+1/2, -y+1/2, -x'
154+
137 '-y+3/4, -z+1/4, -x+3/4'
155+
138 '-x+1/2, -z, y+1/2'
156+
139 'y+1/4, -z+3/4, x+3/4'
157+
140 'x+1/2, -z+1/2, -y'
158+
141 'y+3/4, z+1/4, -x+3/4'
159+
142 'x, z+1/2, y+1/2'
160+
143 '-y+1/4, z+3/4, x+3/4'
161+
144 '-x, z, -y'
162+
145 'x, y+1/2, z+1/2'
163+
146 '-y+1/4, x+3/4, z+3/4'
164+
147 '-x, -y, z'
165+
148 'y+3/4, -x+3/4, z+1/4'
166+
149 'x, -y+1/2, -z+1/2'
167+
150 '-y+1/4, -x+1/4, -z+1/4'
168+
151 '-x, y, -z'
169+
152 'y+3/4, x+1/4, -z+3/4'
170+
153 'z, x+1/2, y+1/2'
171+
154 'z+1/4, -y+3/4, x+3/4'
172+
155 'z+1/2, -x+1/2, -y'
173+
156 'z+3/4, y+1/4, -x+3/4'
174+
157 '-z, x+1/2, -y+1/2'
175+
158 '-z+3/4, -y+3/4, -x+1/4'
176+
159 '-z+1/2, -x+1/2, y'
177+
160 '-z+1/4, y+1/4, x+1/4'
178+
161 'y, z+1/2, x+1/2'
179+
162 'x+1/4, z+3/4, -y+3/4'
180+
163 '-y+1/2, z, -x+1/2'
181+
164 '-x+1/4, z+1/4, y+1/4'
182+
165 '-y, -z+1/2, x+1/2'
183+
166 '-x+3/4, -z+1/4, -y+3/4'
184+
167 'y+1/2, -z, -x+1/2'
185+
168 'x+3/4, -z+3/4, y+1/4'
186+
169 '-x+1/4, -y+3/4, -z+3/4'
187+
170 'y, -x+1/2, -z+1/2'
188+
171 'x+1/4, y+1/4, -z+1/4'
189+
172 '-y+1/2, x+1/2, -z'
190+
173 '-x+1/4, y+3/4, z+3/4'
191+
174 'y, x, z'
192+
175 'x+1/4, -y+1/4, z+1/4'
193+
176 '-y+1/2, -x, z+1/2'
194+
177 '-z+1/4, -x+3/4, -y+3/4'
195+
178 '-z, y+1/2, -x+1/2'
196+
179 '-z+3/4, x+3/4, y+1/4'
197+
180 '-z+1/2, -y, x+1/2'
198+
181 'z+1/4, -x+3/4, y+3/4'
199+
182 'z+1/2, y+1/2, x'
200+
183 'z+3/4, x+3/4, -y+1/4'
201+
184 'z, -y, -x'
202+
185 '-y+1/4, -z+3/4, -x+3/4'
203+
186 '-x, -z+1/2, y+1/2'
204+
187 'y+3/4, -z+1/4, x+3/4'
205+
188 'x, -z, -y'
206+
189 'y+1/4, z+3/4, -x+3/4'
207+
190 'x+1/2, z, y+1/2'
208+
191 '-y+3/4, z+1/4, x+3/4'
209+
192 '-x+1/2, z+1/2, -y'
210+
loop_
211+
_atom_site_type_symbol
212+
_atom_site_label
213+
_atom_site_symmetry_multiplicity
214+
_atom_site_fract_x
215+
_atom_site_fract_y
216+
_atom_site_fract_z
217+
_atom_site_occupancy
218+
Si Si0 8 0.00000000 0.00000000 0.00000000 1

tests/test_data/vasp/Si_gruneisen/POSCAR

Lines changed: 0 additions & 25 deletions
This file was deleted.

0 commit comments

Comments
 (0)