|
12 | 12 | def write_input(input_dict, working_directory="."): |
13 | 13 | filename = os.path.join(working_directory, "input.pwi") |
14 | 14 | os.makedirs(working_directory, exist_ok=True) |
15 | | - try: |
16 | | - write( |
17 | | - filename=filename, |
18 | | - images=Atoms(**input_dict["structure"]), |
19 | | - Crystal=True, |
20 | | - kpts=input_dict["kpts"], |
21 | | - input_data={ |
22 | | - "calculation": input_dict["calculation"], |
23 | | - "occupations": "smearing", |
24 | | - "degauss": input_dict["smearing"], |
25 | | - }, |
26 | | - pseudopotentials=input_dict["pseudopotentials"], |
27 | | - tstress=True, |
28 | | - tprnfor=True, |
29 | | - ) |
30 | | - except KeyError: |
31 | | - print('INPUT_DICT') |
32 | | - print(input_dict) |
| 15 | + write( |
| 16 | + filename=filename, |
| 17 | + images=Atoms(**input_dict["structure"]), |
| 18 | + Crystal=True, |
| 19 | + kpts=input_dict["kpts"], |
| 20 | + input_data={ |
| 21 | + "calculation": input_dict["calculation"], |
| 22 | + "occupations": "smearing", |
| 23 | + "degauss": input_dict["smearing"], |
| 24 | + }, |
| 25 | + pseudopotentials=input_dict["pseudopotentials"], |
| 26 | + tstress=True, |
| 27 | + tprnfor=True, |
| 28 | + ) |
33 | 29 |
|
34 | 30 |
|
35 | 31 | def collect_output(working_directory="."): |
@@ -65,14 +61,6 @@ def generate_structures(structure, strain_lst): |
65 | 61 | return {f"s_{i}": atoms_to_json_dict(atoms=s) for i, s in enumerate(structure_lst)} |
66 | 62 |
|
67 | 63 |
|
68 | | -def scale_structure(structure, strain): |
69 | | - structure_strain = Atoms(**structure) |
70 | | - structure_strain.set_cell( |
71 | | - structure_strain.cell * strain ** (1 / 3), scale_atoms=True |
72 | | - ) |
73 | | - return structure_strain |
74 | | - |
75 | | - |
76 | 64 | def plot_energy_volume_curve(volume_lst, energy_lst): |
77 | 65 | plt.plot(volume_lst, energy_lst) |
78 | 66 | plt.xlabel("Volume") |
|
0 commit comments