7
7
"""An example testing the restart calculation handler for geo_opt run in CP2K."""
8
8
9
9
import os
10
- import sys
11
10
import random
12
- import numpy as np
11
+ import sys
13
12
14
13
import ase .io
15
14
import click
16
- from ase import Atoms
15
+ import numpy as np
17
16
from aiida .common import NotExistent
18
17
from aiida .engine import run
19
18
from aiida .orm import Dict , SinglefileData , load_code
20
19
from aiida .plugins import DataFactory , WorkflowFactory
20
+ from ase import Atoms
21
21
22
22
Cp2kBaseWorkChain = WorkflowFactory ("cp2k.base" )
23
23
StructureData = DataFactory ("core.structure" )
@@ -47,14 +47,19 @@ def example_base(cp2k_code):
47
47
)
48
48
49
49
# Trajectory.
50
- steps = 20
51
- positions = np .array ([[[2 ,2 ,2.73 + 0.05 * random .random ()],[2 ,2 ,2 ]] for i in range (steps )])
52
- cells = np .array ([[[4 ,0 ,0 ],[0 ,4 ,0 ],[0 ,0 ,4.75 + 0.05 * random .random ()]]for i in range (steps )])
53
- symbols = ['H' ,'H' ]
50
+ steps = 20
51
+ positions = np .array (
52
+ [[[2 , 2 , 2.73 + 0.05 * random .random ()], [2 , 2 , 2 ]] for i in range (steps )]
53
+ )
54
+ cells = np .array (
55
+ [
56
+ [[4 , 0 , 0 ], [0 , 4 , 0 ], [0 , 0 , 4.75 + 0.05 * random .random ()]]
57
+ for i in range (steps )
58
+ ]
59
+ )
60
+ symbols = ["H" , "H" ]
54
61
trajectory = TrajectoryData ()
55
62
trajectory .set_trajectory (symbols , positions , cells = cells )
56
-
57
-
58
63
59
64
# Parameters.
60
65
parameters = Dict (
@@ -69,14 +74,14 @@ def example_base(cp2k_code):
69
74
"MD" : {
70
75
"ENSEMBLE" : "REFTRAJ" ,
71
76
"STEPS" : steps ,
72
- "REFTRAJ" :{
73
- ' FIRST_SNAPSHOT' : 1 ,
74
- ' LAST_SNAPSHOT' : steps ,
75
- ' EVAL_FORCES' : ' .TRUE.' ,
76
- ' TRAJ_FILE_NAME' : ' trajectory.xyz' ,
77
- ' CELL_FILE_NAME' : ' reftraj.cell' ,
78
- ' VARIABLE_VOLUME' : ' .TRUE.'
79
- },
77
+ "REFTRAJ" : {
78
+ " FIRST_SNAPSHOT" : 1 ,
79
+ " LAST_SNAPSHOT" : steps ,
80
+ " EVAL_FORCES" : " .TRUE." ,
81
+ " TRAJ_FILE_NAME" : " trajectory.xyz" ,
82
+ " CELL_FILE_NAME" : " reftraj.cell" ,
83
+ " VARIABLE_VOLUME" : " .TRUE." ,
84
+ },
80
85
},
81
86
"PRINT" : {
82
87
"RESTART" : {
@@ -135,7 +140,7 @@ def example_base(cp2k_code):
135
140
},
136
141
],
137
142
},
138
- }
143
+ },
139
144
}
140
145
)
141
146
0 commit comments