示例#1
0
natoms = 40

coords = np.random.rand(natoms * 3)

lj = LJ()

ret = quench(coords, lj)
coords = ret.coords

takestep = TakeStep(stepsize=0.1)

#do equilibration steps, adjusting stepsize
tsadapt = AdaptiveStepsize(takestep)
mc = MonteCarlo(coords, lj, tsadapt, temperature=0.5)
equilout = open("equilibration", "w")
#mc.outstream = equilout
mc.setPrinting(equilout, 1)
mc.run(10000)

#fix stepsize and do production run
mc.takeStep = takestep
mcout = open("mc.out", "w")
mc.setPrinting(mcout, 10)
#print coords from time to time
xyzout = open("out.xyz", "w")
printevent = PrintEvent(xyzout, 300)
mc.addEventAfterStep(printevent.printwrapper)

mc.run(10000)
示例#2
0
文件: LJ_MC.py 项目: wwwtyro/PyGMIN
natoms = 40

coords = np.random.rand(natoms*3)


lj = LJ() 

ret = quench(coords, lj.getEnergyGradient)
coords = ret[0]

takestep = TakeStep(stepsize=0.1 )

#do equilibration steps, adjusting stepsize
tsadapt = AdaptiveStepsize(takestep)
mc = MonteCarlo(coords, lj, tsadapt, temperature = 0.5)
equilout = open("equilibration","w")
#mc.outstream = equilout
mc.setPrinting(equilout, 1)
mc.run(10000)

#fix stepsize and do production run
mc.takeStep = takestep
mcout = open("mc.out", "w")
mc.setPrinting(mcout, 10)
#print coords from time to time
xyzout = open("out.xyz", "w")
printevent = PrintEvent(xyzout, 300)
mc.addEventAfterStep(printevent.printwrapper)

mc.run(10000)