本文整理汇总了Python中ase.lattice.cubic.FaceCenteredCubic.get_temperature方法的典型用法代码示例。如果您正苦于以下问题:Python FaceCenteredCubic.get_temperature方法的具体用法?Python FaceCenteredCubic.get_temperature怎么用?Python FaceCenteredCubic.get_temperature使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ase.lattice.cubic.FaceCenteredCubic
的用法示例。
在下文中一共展示了FaceCenteredCubic.get_temperature方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: atoms
# 需要导入模块: from ase.lattice.cubic import FaceCenteredCubic [as 别名]
# 或者: from ase.lattice.cubic.FaceCenteredCubic import get_temperature [as 别名]
print "Timing with %i atoms (%i threads)" % (natoms, nthreads)
blocksize = int(np.ceil((natoms/4)**(1./3.)))
atoms = FaceCenteredCubic(symbol='Cu', size=(blocksize,blocksize,blocksize), pbc=False)
print "Creating block with %i atoms, cutting to %i atoms" % (len(atoms), natoms)
atoms = atoms[:natoms]
assert len(atoms) == natoms
atoms.set_calculator(EMT())
MaxwellBoltzmannDistribution(atoms, 2 * T * units.kB)
dyn = VelocityVerlet(atoms, 5*units.fs)
ptsteps = int(laststeps * (0.1 * targettime / lasttime) * lastsize / natoms)
if ptsteps < 100:
ptsteps = 100
print "Running pre-timing (%i steps)..." % (ptsteps,)
t1 = time.time()
dyn.run(ptsteps - 50)
MaxwellBoltzmannDistribution(atoms, (2 * T - atoms.get_temperature()) * units.kB)
dyn.run(50)
t1 = time.time() - t1
steps = int(ptsteps * targettime / t1)
if steps < 200:
steps = 200
print "Temperature is %.1f K" % (atoms.get_temperature(),)
print "Running main timing (%i steps)" % (steps,)
MaxwellBoltzmannDistribution(atoms, T * units.kB)
t1 = time.time()
dyn.run(steps)
t1 = time.time() - t1
lasttime = t1
print "... done in %.1f s (T = %.1f K)." % (t1, atoms.get_temperature())
t1 *= 1e6 / (natoms * steps)
print "RESULT: %.3f us/atom/step (%i atoms, %i threads)" % (t1, natoms, nthreads)