|
2 | 2 | from pymatgen.core import Lattice, Species, Structure
|
3 | 3 | from pymatgen.io.vasp.sets import MPScanRelaxSet
|
4 | 4 |
|
5 |
| -from atomate2.vasp.sets.core import StaticSetGenerator |
| 5 | +from atomate2.vasp.sets.core import ( |
| 6 | + ElectronPhononSetGenerator, |
| 7 | + HSEBSSetGenerator, |
| 8 | + HSERelaxSetGenerator, |
| 9 | + HSEStaticSetGenerator, |
| 10 | + HSETightRelaxSetGenerator, |
| 11 | + LobsterTightStaticSetGenerator, |
| 12 | + MDSetGenerator, |
| 13 | + NonSCFSetGenerator, |
| 14 | + RelaxConstVolSetGenerator, |
| 15 | + RelaxSetGenerator, |
| 16 | + StaticSetGenerator, |
| 17 | + TightRelaxConstVolSetGenerator, |
| 18 | + TightRelaxSetGenerator, |
| 19 | +) |
6 | 20 |
|
7 | 21 |
|
8 | 22 | @pytest.fixture(scope="module")
|
@@ -199,3 +213,82 @@ def test_set_kspacing_bandgap_tol_and_auto_ismear(
|
199 | 213 |
|
200 | 214 | actual = {key: incar[key] for key in expected_params}
|
201 | 215 | assert actual == pytest.approx(expected_params)
|
| 216 | + |
| 217 | + |
| 218 | +def test_core(struct_no_magmoms): |
| 219 | + input_gen = RelaxSetGenerator() |
| 220 | + incar = input_gen.get_input_set(struct_no_magmoms, potcar_spec=True)["INCAR"] |
| 221 | + assert incar["ISIF"] == 3 |
| 222 | + assert incar["IBRION"] == 2 |
| 223 | + |
| 224 | + input_gen = RelaxConstVolSetGenerator() |
| 225 | + incar = input_gen.get_input_set(struct_no_magmoms, potcar_spec=True)["INCAR"] |
| 226 | + assert incar["ISIF"] == 2 |
| 227 | + assert incar["IBRION"] == 2 |
| 228 | + assert incar["EDIFF"] == 1e-5 |
| 229 | + |
| 230 | + input_gen = TightRelaxSetGenerator() |
| 231 | + incar = input_gen.get_input_set(struct_no_magmoms, potcar_spec=True)["INCAR"] |
| 232 | + assert incar["ISIF"] == 3 |
| 233 | + assert incar["IBRION"] == 2 |
| 234 | + assert incar["EDIFF"] == 1e-7 |
| 235 | + |
| 236 | + input_gen = TightRelaxConstVolSetGenerator() |
| 237 | + incar = input_gen.get_input_set(struct_no_magmoms, potcar_spec=True)["INCAR"] |
| 238 | + assert incar["ISIF"] == 2 |
| 239 | + assert incar["IBRION"] == 2 |
| 240 | + assert incar["EDIFF"] == 1e-7 |
| 241 | + |
| 242 | + input_gen = StaticSetGenerator() |
| 243 | + incar = input_gen.get_input_set(struct_no_magmoms, potcar_spec=True)["INCAR"] |
| 244 | + assert incar["ISMEAR"] == -5 |
| 245 | + assert incar["NSW"] == 0 |
| 246 | + |
| 247 | + input_gen = NonSCFSetGenerator() |
| 248 | + incar = input_gen.get_input_set(struct_no_magmoms, potcar_spec=True)["INCAR"] |
| 249 | + assert incar["NSW"] == 0 |
| 250 | + assert incar["ISYM"] == 0 |
| 251 | + |
| 252 | + input_gen = HSERelaxSetGenerator() |
| 253 | + incar = input_gen.get_input_set(struct_no_magmoms, potcar_spec=True)["INCAR"] |
| 254 | + assert incar["PRECFOCK"] == "Fast" |
| 255 | + assert incar["HFSCREEN"] == 0.2 |
| 256 | + assert incar["EDIFF"] == 1e-5 |
| 257 | + |
| 258 | + input_gen = HSETightRelaxSetGenerator() |
| 259 | + incar = input_gen.get_input_set(struct_no_magmoms, potcar_spec=True)["INCAR"] |
| 260 | + assert incar["PRECFOCK"] == "Fast" |
| 261 | + assert incar["HFSCREEN"] == 0.2 |
| 262 | + assert incar["EDIFF"] == 1e-7 |
| 263 | + |
| 264 | + input_gen = HSEStaticSetGenerator() |
| 265 | + incar = input_gen.get_input_set(struct_no_magmoms, potcar_spec=True)["INCAR"] |
| 266 | + assert incar["PRECFOCK"] == "Fast" |
| 267 | + assert incar["HFSCREEN"] == 0.2 |
| 268 | + assert incar["EDIFF"] == 1e-5 |
| 269 | + assert incar["NSW"] == 0 |
| 270 | + |
| 271 | + input_gen = HSEBSSetGenerator() |
| 272 | + incar = input_gen.get_input_set(struct_no_magmoms, potcar_spec=True)["INCAR"] |
| 273 | + assert incar["PRECFOCK"] == "Fast" |
| 274 | + assert incar["HFSCREEN"] == 0.2 |
| 275 | + assert incar["EDIFF"] == 1e-5 |
| 276 | + assert incar["NSW"] == 0 |
| 277 | + assert incar["ISMEAR"] == 0 |
| 278 | + |
| 279 | + input_gen = ElectronPhononSetGenerator() |
| 280 | + incar = input_gen.get_input_set(struct_no_magmoms, potcar_spec=True)["INCAR"] |
| 281 | + assert incar["PHON_NSTRUCT"] == 0 |
| 282 | + assert incar["NSW"] == 1 |
| 283 | + assert incar["ISMEAR"] == 0 |
| 284 | + |
| 285 | + input_gen = MDSetGenerator() |
| 286 | + incar = input_gen.get_input_set(struct_no_magmoms, potcar_spec=True)["INCAR"] |
| 287 | + assert incar["TEBEG"] == 300 |
| 288 | + assert incar["TEEND"] == 300 |
| 289 | + |
| 290 | + input_gen = LobsterTightStaticSetGenerator() |
| 291 | + incar = input_gen.get_input_set(struct_no_magmoms, potcar_spec=True)["INCAR"] |
| 292 | + assert incar["EDIFF"] == 1e-7 |
| 293 | + assert incar["ISYM"] == 0 |
| 294 | + assert incar["LWAVE"] is True |
0 commit comments