Example #1
0
size = (30, 25, 7)
n_avg = 25
n_output = 50
n_total = 2 * n_output

atoms = FaceCenteredCubic(directions=((1, 1, -2), (-1, 1, 0), (1, 1, 1)),
                          size=size,
                          element="Au",
                          debug=0,
                          periodic=(0, 0, 1))
basis = atoms.GetUnitCell()

center = 0.5 * array([basis[0, 0], basis[1, 1], basis[2, 2]]) + array(
    [0.1, 0.1, 0.1])

disl = Dislocation(center, atoms.MillerToDirection((1, 1, 0)),
                   atoms.MillerToDirection((1, 1, 0)) / 2.0)

#atoms = ListOfAtoms(slab)
disl.ApplyTo(atoms)

atoms.SetCalculator(EMT(EMTRasmussenParameters()))

# Constant temperatur dynamics
dyn = Langevin(atoms, 5 * femtosecond, 300 * kB, 0.002)

# Run Common Neighbor Analysis on each n_output timestep, using the
# positions averaged over the last n_avg timesteps, and writing the
# result to the output file.
avg = TimeAveragedPositions(atoms, n_avg, n_output)
dyn.Attach(avg)