Skip to content

Commit

Permalink
breaking vdW bonds that are not connected in the graph
Browse files Browse the repository at this point in the history
  • Loading branch information
davidfarinajr committed Jan 27, 2021
1 parent 6eb65fd commit 9d05913
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions rmgpy/data/kinetics/family.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,13 @@ def _apply(self, struct, forward, unique):
atom2.apply_action(['FORM_BOND', label1, info, label2])
elif (action[0] == 'BREAK_BOND' and forward) or (action[0] == 'FORM_BOND' and not forward):
if not struct.has_bond(atom1, atom2):
if info == 0:
if atom1.is_surface_site() or atom2.is_surface_site():
# We are trying to break a vdW bond, but the atoms are not connected in
# the graph. The bond will break when we split the merged products
# in the `apply_recipe()` functions. Thus, there is nothing to do here,
# so we continue to the next action.
continue
raise InvalidActionError('Attempted to remove a nonexistent bond.')
bond = struct.get_bond(atom1, atom2)
struct.remove_bond(bond)
Expand Down

0 comments on commit 9d05913

Please sign in to comment.