Skip to content

Commit

Permalink
Merge pull request #1 from francoep/patch-1
Browse files Browse the repository at this point in the history
Update uffminimize.py
  • Loading branch information
dkoes authored Apr 15, 2019
2 parents e264f32 + 2c3587c commit e2b22aa
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion uffminimize.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,12 @@
if mol is not None:
try:
orig = Chem.UFFGetMoleculeForceField(mol).CalcEnergy()
Chem.UFFOptimizeMolecule(mol)
a=Chem.UFFOptimizeMolecule(mol)

#sometimes the UFF Optimization does not converge (returns a 1 instead of 0)
if a==1:
a=Chem.UFFOptimizeMolecule(mol, maxIter=1000)

if options.verbose:
e = Chem.UFFGetMoleculeForceField(mol).CalcEnergy()
print mol.GetProp('_Name'),orig,"->",e
Expand Down

0 comments on commit e2b22aa

Please sign in to comment.