Skip to content

Commit

Permalink
When spacing out images fail, NEB will be carried using the last iter…
Browse files Browse the repository at this point in the history
…ated chain instead of raising an error.
  • Loading branch information
hjnpark committed Apr 19, 2024
1 parent e48365c commit 79029f7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
3 changes: 0 additions & 3 deletions geometric/errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,6 @@ class NEBChainError(Error):
class NEBChainShapeError(NEBChainError):
pass

class NEBChainRespaceError(NEBChainError):
pass

class NEBBandError(Error):
pass

Expand Down
7 changes: 3 additions & 4 deletions geometric/neb.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from .internal import CartesianCoordinates, PrimitiveInternalCoordinates, DelocalizedInternalCoordinates, ChainCoordinates
from .nifty import flat, row, col, createWorkQueue, getWorkQueue, wq_wait, ang2bohr, bohr2ang, kcal2au, au2kcal, au2evang, logger
from .molecule import EqualSpacing
from .errors import NEBStructureError, NEBChainShapeError, NEBChainRespaceError, NEBBandTangentError, NEBBandGradientError
from .errors import NEBStructureError, NEBChainShapeError, NEBBandTangentError, NEBBandGradientError
from .config import config_dir

def print_forces(chain, avgg, maxg):
Expand Down Expand Up @@ -586,9 +586,8 @@ def delete_insert(self, thresh):
break
nloop += 1
if nloop > len(self):
raise NEBChainRespaceError(
"Stuck in a loop, bug likely! Try again with more number of images."
)
logger.info("Spacing out images could not be completed within %i iterations. NEB will be performed with the last iterated chain. \n" %nloop)
break
if respaced:
self.clearCalcs(clearEngine=False)
logger.info("Image Number :"+" ".join([" %3i " % i for i in range(len(self))])+'\n')
Expand Down

0 comments on commit 79029f7

Please sign in to comment.