Skip to content

Commit c82691d

Browse files
committed
boh
2 parents 8c5083d + 0579f0c commit c82691d

File tree

2 files changed

+34
-4
lines changed

2 files changed

+34
-4
lines changed

aiida_cp2k/calculations/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
###############################################################################
77
"""AiiDA-CP2K input plugin."""
88

9-
import numpy as np
109
from operator import add
1110

11+
import numpy as np
1212
from aiida.common import CalcInfo, CodeInfo, InputValidationError
1313
from aiida.engine import CalcJob
1414
from aiida.orm import Dict, RemoteData, SinglefileData
@@ -458,7 +458,7 @@ def _trajectory_to_xyz_and_cell(trajectory, atoms):
458458
xyz = ""
459459
elem_symbols = kind_names(atoms)
460460

461-
for (i,step) in enumerate(trajectory.get_array("positions")):
461+
for i, step in enumerate(trajectory.get_array("positions")):
462462
elem_coords = [f"{p[0]:25.16f} {p[1]:25.16f} {p[2]:25.16f}" for p in step]
463463
xyz += f"{len(elem_coords)}\n"
464464
xyz += f"i = {i+1} , time = {(i+1)*0.5} \n"

examples/single_calculations/example_dft_md_reftraj.py

Lines changed: 32 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
import sys
1111
import random
1212

13+
import ase.io
1314
import click
1415
import numpy as np
15-
import ase.io
1616
from aiida.common import NotExistent
1717
from aiida.engine import run
1818
from aiida.orm import Dict, SinglefileData, load_code
@@ -36,10 +36,28 @@ def example_dft_md_reftraj(cp2k_code):
3636
)
3737

3838
# Trajectory.
39+
<<<<<<< HEAD
3940
steps=5
4041
positions = np.array([[[2,2,2.73+0.05*random.random()],[2,2,2]] for i in range(steps)])
4142
cells = np.array([[[4,0,0],[0,4,0],[0,0,4.75+0.05*random.random()]]for i in range(steps)])
4243
symbols=['H','H']
44+
=======
45+
positions = np.array(
46+
[
47+
[[2, 2, 2.73], [2, 2, 2.0]],
48+
[[2, 2, 2.74], [2, 2, 2.0]],
49+
[[2, 2, 2.75], [2, 2, 2.0]],
50+
]
51+
)
52+
cells = np.array(
53+
[
54+
[[4, 0, 0], [0, 4, 0], [0, 0, 4.75]],
55+
[[4.4, 0, 0], [0, 4.2, 0], [0, 0, 4.76]],
56+
[[4, 0, 0], [0, 4.1, 0], [0, 0, 4.75]],
57+
]
58+
)
59+
symbols = ["H", "H"]
60+
>>>>>>> 0579f0ce4b6ee754292a941572730fae741122cd
4361
trajectory = TrajectoryData()
4462
trajectory.set_trajectory(symbols, positions, cells=cells)
4563

@@ -65,6 +83,7 @@ def example_dft_md_reftraj(cp2k_code):
6583
"MOTION": {
6684
"MD": {
6785
"ENSEMBLE": "REFTRAJ",
86+
<<<<<<< HEAD
6887
"STEPS": steps,
6988
"REFTRAJ":{
7089
'FIRST_SNAPSHOT':1,
@@ -74,6 +93,17 @@ def example_dft_md_reftraj(cp2k_code):
7493
'CELL_FILE_NAME':'reftraj.cell',
7594
'VARIABLE_VOLUME':'.TRUE.'
7695
},
96+
=======
97+
"STEPS": 3,
98+
"REFTRAJ": {
99+
"FIRST_SNAPSHOT": 1,
100+
"LAST_SNAPSHOT": 3,
101+
"EVAL_FORCES": ".TRUE.",
102+
"TRAJ_FILE_NAME": "trajectory.xyz",
103+
"CELL_FILE_NAME": "reftraj.cell",
104+
"VARIABLE_VOLUME": ".TRUE.",
105+
},
106+
>>>>>>> 0579f0ce4b6ee754292a941572730fae741122cd
77107
},
78108
"PRINT": {
79109
"RESTART": {
@@ -132,7 +162,7 @@ def example_dft_md_reftraj(cp2k_code):
132162
},
133163
],
134164
},
135-
}
165+
},
136166
}
137167
)
138168

0 commit comments

Comments
 (0)