Skip to content

Commit 44d152a

Browse files
committed
Merge branch 'feature/traj-input' of https://github.com/aiidateam/aiida-cp2k into feature/traj-input
2 parents 61a7e9f + e66a89c commit 44d152a

File tree

1 file changed

+19
-12
lines changed

1 file changed

+19
-12
lines changed

examples/single_calculations/example_dft_md_reftraj.py

Lines changed: 19 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,17 @@ def example_dft_md_reftraj(cp2k_code):
3636
)
3737

3838
# Trajectory.
39-
steps=5
40-
positions = np.array([[[2,2,2.73+0.05*random.random()],[2,2,2]] for i in range(steps)])
41-
cells = np.array([[[4,0,0],[0,4,0],[0,0,4.75+0.05*random.random()]]for i in range(steps)])
42-
symbols=['H','H']
39+
steps = 5
40+
positions = np.array(
41+
[[[2, 2, 2.73 + 0.05 * random.random()], [2, 2, 2]] for i in range(steps)]
42+
)
43+
cells = np.array(
44+
[
45+
[[4, 0, 0], [0, 4, 0], [0, 0, 4.75 + 0.05 * random.random()]]
46+
for i in range(steps)
47+
]
48+
)
49+
symbols = ["H", "H"]
4350
trajectory = TrajectoryData()
4451
trajectory.set_trajectory(symbols, positions, cells=cells)
4552

@@ -66,14 +73,14 @@ def example_dft_md_reftraj(cp2k_code):
6673
"MD": {
6774
"ENSEMBLE": "REFTRAJ",
6875
"STEPS": steps,
69-
"REFTRAJ":{
70-
'FIRST_SNAPSHOT':1,
71-
'LAST_SNAPSHOT':steps,
72-
'EVAL_FORCES':'.TRUE.',
73-
'TRAJ_FILE_NAME':'trajectory.xyz',
74-
'CELL_FILE_NAME':'reftraj.cell',
75-
'VARIABLE_VOLUME':'.TRUE.'
76-
},
76+
"REFTRAJ": {
77+
"FIRST_SNAPSHOT": 1,
78+
"LAST_SNAPSHOT": steps,
79+
"EVAL_FORCES": ".TRUE.",
80+
"TRAJ_FILE_NAME": "trajectory.xyz",
81+
"CELL_FILE_NAME": "reftraj.cell",
82+
"VARIABLE_VOLUME": ".TRUE.",
83+
},
7784
},
7885
"PRINT": {
7986
"RESTART": {

0 commit comments

Comments
 (0)