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) cna = RestrictedCNA(avg, verbose=1) avg.Attach(cna) # We output and plot the instantaneous positions. Replace atoms with # avg to output and plot the averaged positions instead. plotlog = open("plot.log", "w")