示例#1
0
    parser.print_help()
    exit(-1)

infile = args[0]
outfile = infile
   
# initialize GMIN
GMIN.initialize()
pot = gminpotential.GMINPotential(GMIN)
crystals.GMIN = GMIN

# open the storage class
db_in = Database(db=infile)
if(options.out!=None):
    outfile = options.out
    db_out = Database(db=outfile)

print("Start to reoptimize minima")
for m in db_in.minima():
    print("optimizing minima",m._id,", energy", m.energy)
    ret = dmagmin.quenchCrystal(m.coords, pot.getEnergyGradient, tol=options.tol, maxErise=options.maxErise)
    print("new energy",ret[1],"(difference %f)"%(ret[1] - m.energy))
    print()
    if(options.out!=None):
        db_out.addMinimum(ret[1], ret[0])
    else:
        m.energy = ret[1]
        m.coords = ret[0]
        db_in.session.commit()
    
示例#2
0
文件: reoptimize.py 项目: jaotta/pele
if len(args) != 1:
    parser.print_help()
    exit(-1)

infile = args[0]
outfile = infile

# initialize GMIN
GMIN.initialize()
pot = gminpotential.GMINPotential(GMIN)
crystals.GMIN = GMIN

# open the storage class
db_in = Database(db=infile)
if options.out != None:
    outfile = options.out
    db_out = Database(db=outfile)

print "Start to reoptimize minima"
for m in db_in.minima():
    print "optimizing minima", m._id, ", energy", m.energy
    ret = dmagmin.quenchCrystal(m.coords, pot.getEnergyGradient, tol=options.tol, maxErise=options.maxErise)
    print "new energy", ret[1], "(difference %f)" % (ret[1] - m.energy)
    print
    if options.out != None:
        db_out.addMinimum(ret[1], ret[0])
    else:
        m.energy = ret[1]
        m.coords = ret[0]
        db_in.session.commit()