-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathexample_01.py
executable file
·59 lines (45 loc) · 1.54 KB
/
example_01.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
#!/usr/bin/env runaiida
"""Examplary script to submit a SkeafCalculation."""
# pylint: disable=unused-import
import pathlib
from aiida import engine, orm
from aiida_skeaf.calculations import SkeafCalculation
from aiida_skeaf.calculations.functions import create_bxsf_from_file
INPUT_DIR = pathlib.Path(__file__).absolute().parent / "input_files"
def submit():
"""Submit a SkeafCalculation."""
# Create a RemoteData from a bxsf file
remote_path = orm.Str(str(INPUT_DIR / "cylinder.bxsf"))
computer = orm.Str("localhost")
bxsf = create_bxsf_from_file(remote_path, computer)
# Or load it
# bxsf = orm.load_node(137231)
skeaf_code = orm.load_code("skeaf@localhost")
parameters = {
"fermi_energy": 0.086887,
"num_interpolation": 50,
"theta": 0.000000,
"phi": 0.000000,
"h_vector_direction": "r",
"min_extremal_frequency": 0.01,
"max_orbit_frequency_diff": 0.01,
"max_orbit_coordinate_diff": 0.05,
"near_wall_orbit": False,
"starting_theta": 0.000000,
"ending_theta": 0.000000,
"starting_phi": 0.000000,
"ending_phi": 90.000000,
"num_rotation": 90,
}
inputs = {
"code": skeaf_code,
"parameters": parameters,
"bxsf": bxsf,
}
calc = engine.submit(SkeafCalculation, **inputs)
print(f"Submitted {calc}")
# Once finished, plot the frequency vs angle
# from aiida_skeaf.utils.plot import plot_frequency
# plot_frequency(calc)
if __name__ == "__main__":
submit()