File: test_forcecurve.py

package info (click to toggle)
python-ase 3.21.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 13,936 kB
  • sloc: python: 122,428; xml: 946; makefile: 111; javascript: 47
file content (20 lines) | stat: -rw-r--r-- 528 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from ase.build import bulk
from ase.calculators.emt import EMT
from ase.utils.forcecurve import force_curve
from ase.md import VelocityVerlet
from ase.units import fs
from ase.io import read


def test_forcecurve(plt):
    atoms = bulk('Au', cubic=True) * (2, 1, 1)
    atoms.calc = EMT()
    atoms.rattle(stdev=0.05)

    with VelocityVerlet(atoms, timestep=12.0 * fs, trajectory='tmp.traj') as md:
        md.run(steps=10)
    images = read('tmp.traj', ':')
    force_curve(images)

    # import pylab as plt
    # plt.show()