Exemplo n.º 1
0
        for j, i in zip(a, c):
            b.write(
                str(j.symbol) + ' ' + str(i[0]) + ' ' + str(i[1]) + ' ' +
                str(i[2]) + '\n')


dyn.attach(printenergy, interval=50)
#dyn.attach(MDLogger(dyn, bz, 'bz_md_NVT_10ps_1fs.log', header=True, stress=False,
#           peratom=False, mode="w"), interval=50)

#traj = Trajectory('killerapp.traj', 'w', atoms=bz)
#dyn.attach(traj.write, interval=100)

printenergy()

dyn.set_temperature(300.0 * units.kB)
start_time2 = time.time()
dyn.run(20000)  # Do 5ps of MD
end_time2 = time.time()
print('Post-heat Total Time:', end_time2 - start_time2)

#dyn = LBFGS(bz)
#dyn.run(fmax=0.0001)
#dyn = BFGS(bz)
#dyn.run(fmax=0.1)
#print('[ANI Total time:', time.time() - start_time, 'seconds]')

# Write visualization of molecule
#f = open("optmol_final.xyz",'w')
#f.write('\n' + str(len(bz)) + '\n')
#for i in bz:
Exemplo n.º 2
0
    #print('Step %i - Energy per atom: Epot = %.3feV  Ekin = %.3feV (T=%3.0fK)  '
    #      'Etot = %.3feV' % (d.get_number_of_steps(),epot, ekin, ekin / (1.5 * units.kB), epot + ekin))
    t.write(
        str(d.get_number_of_steps()) + ' ' + str(d.get_time()) + ' ' +
        str(ekin / (1.5 * units.kB)) + ' ' + str(epot) + ' ' + str(ekin) +
        ' ' + str(epot + ekin) + '\n')
    b.write('\n' + str(len(a)) + '\n')
    c = a.get_positions(wrap=True)
    for j, i in zip(a, c):
        b.write(
            str(j.symbol) + ' ' + str(i[0]) + ' ' + str(i[1]) + ' ' +
            str(i[2]) + '\n')


dyn.attach(printenergy, interval=50)
dyn.set_temperature(T * units.kB)
start_time2 = time.time()

# get the chemical symbols
spc = mol.get_chemical_symbols()

#xo = open(stdir + 'data/md-peptide-cvnms.xyz', 'w')
f = open(stdir + 'md-peptide-cv.dat', 'w')
l_sigma = []

for i in range(10000):
    dyn.run(100)  # Do 100 steps of MD

    xyz = np.array(mol.get_positions(), dtype=np.float32).reshape(len(spc), 3)
    energies = np.zeros((5), dtype=np.float64)
    forces = []