本文整理汇总了Python中ase.optimize.BFGS.get_number_of_steps方法的典型用法代码示例。如果您正苦于以下问题:Python BFGS.get_number_of_steps方法的具体用法?Python BFGS.get_number_of_steps怎么用?Python BFGS.get_number_of_steps使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ase.optimize.BFGS
的用法示例。
在下文中一共展示了BFGS.get_number_of_steps方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: open
# 需要导入模块: from ase.optimize import BFGS [as 别名]
# 或者: from ase.optimize.BFGS import get_number_of_steps [as 别名]
#combines all images into one file with energies written for each structure
inFile = open(os.path.join(path, 'structure%03d' % (i,) +'.xyz'), 'r')
linesInFile = list()
for line in inFile:
linesInFile.append(line)
numOfLines = len(linesInFile)
outFile = open(outFileName, 'a')
outFile.write(linesInFile[0])
outFile.write(linesInFile[numOfLines-1])
for i in range(1, numOfLines-1):
outFile.write(linesInFile[i])
#writes the trajectory file in .xyz format
if os.path.exists("gradient"):
os.remove("gradient")
nsteps = dyn.get_number_of_steps()
for j in range(0, numOfImages):
traj = PickleTrajectory('neb-%01d.traj' % (j,))
path1 = os.getcwd()
path1 = path1 + '/scratch%01d' % (j,)
if not os.path.exists(path1): os.makedirs(path1)
outFileName1 = 'trajectory%03d' % (j,) + '.xyz'
fh = open("gradient", 'a')
fh.write("\n")
fh.write(str('********neb-%01d.traj' % (j,)))
fh.write(" Printing information for image %01d **********" % ((j+1),))
for i in range(0, nsteps+1):
atoms = traj[i]
string1 = 'structure%03d' % (i,) +'.xyz'
outStruct1 = os.path.join(path1, string1)