当前位置: 首页>>代码示例>>Python>>正文


Python FaceCenteredCubic.get_temperature方法代码示例

本文整理汇总了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)
开发者ID:auag92,项目名称:n2dm,代码行数:33,代码来源:TimingMatrix.py


注:本文中的ase.lattice.cubic.FaceCenteredCubic.get_temperature方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。