root / ase / test / vacancy.py @ 1
Historique | Voir | Annoter | Télécharger (1,09 ko)
1 |
from ase import Atoms |
---|---|
2 |
from ase.optimize import QuasiNewton |
3 |
from ase.neb import NEB |
4 |
from ase.optimize.mdmin import MDMin |
5 |
try:
|
6 |
from asap3 import EMT |
7 |
except ImportError: |
8 |
pass
|
9 |
else:
|
10 |
|
11 |
a = 3.6
|
12 |
b = a / 2
|
13 |
initial = Atoms('Cu4',
|
14 |
positions=[(0, 0, 0), |
15 |
(0, b, b),
|
16 |
(b, 0, b),
|
17 |
(b, b, 0)],
|
18 |
cell=(a, a, a), |
19 |
pbc=True)
|
20 |
initial *= (4, 4, 4) |
21 |
del initial[0] |
22 |
images = [initial] + [initial.copy() for i in range(6)] |
23 |
images[-1].positions[0] = (0, 0, 0) |
24 |
for image in images: |
25 |
image.set_calculator(EMT()) |
26 |
#image.set_calculator(ASAP())
|
27 |
|
28 |
for image in [images[0], images[-1]]: |
29 |
QuasiNewton(image).run(fmax=0.01)
|
30 |
neb = NEB(images) |
31 |
neb.interpolate() |
32 |
|
33 |
for a in images: |
34 |
print a.positions[0], a.get_potential_energy() |
35 |
|
36 |
dyn = MDMin(neb, dt=0.1, trajectory='mep1.traj') |
37 |
#dyn = QuasiNewton(neb)
|
38 |
print dyn.run(fmax=0.01, steps=25) |
39 |
for a in images: |
40 |
print a.positions[0], a.get_potential_energy() |