Skip to content

Commit e6ef712

Browse files
committed
change is_molecule_forbidden
1 parent c4fea25 commit e6ef712

File tree

2 files changed

+18
-5
lines changed

2 files changed

+18
-5
lines changed

rmgpy/data/kinetics/family.py

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1670,11 +1670,22 @@ def is_molecule_forbidden(self, molecule):
16701670
return True
16711671

16721672
# forbid vdw multi-dentate molecules for surface families
1673+
surface_sites = []
16731674
if "surface" in self.label.lower():
1674-
if molecule.get_num_atoms('X') > 1:
1675-
for atom in molecule.atoms:
1676-
if atom.atomtype.label == 'Xv':
1677-
return True
1675+
if "surface_monodentate_to_vdw_bidentate" in self.label.lower() and molecule.get_num_atoms('X') > 1:
1676+
surface_sites = [atom.atomtype.label for atom in molecule.atoms if 'X' in atom.atomtype.label]
1677+
if all(site == 'Xv' for site in surface_sites):
1678+
return True
1679+
else:
1680+
if molecule.get_num_atoms('X') > 1:
1681+
for atom in molecule.atoms:
1682+
if atom.atomtype.label == 'Xv':
1683+
return True
1684+
# elif "surface" in self.label.lower():
1685+
# if molecule.get_num_atoms('X') > 1:
1686+
# for atom in molecule.atoms:
1687+
# if atom.atomtype.label == 'Xv':
1688+
# return True
16781689

16791690
return False
16801691

rmgpy/molecule/molecule.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@
6262

6363
################################################################################
6464

65-
bond_orders = {'S': 1, 'D': 2, 'T': 3, 'B': 1.5}
65+
bond_orders = {'S': 1, 'D': 2, 'T': 3, 'B': 1.5, 'vdW': 0}
6666

6767
globals().update({
6868
'bond_orders': bond_orders,
@@ -2952,6 +2952,8 @@ def get_desorbed_molecules(self):
29522952
bonded_atom.increment_radical()
29532953
bonded_atom.increment_lone_pairs()
29542954
bonded_atom.label = '*4'
2955+
elif bond.is_van_der_waals():
2956+
bonded_atom.label = '*5'
29552957
else:
29562958
raise NotImplementedError("Can't remove surface bond of type {}".format(bond.order))
29572959
desorbed_molecule.remove_atom(site)

0 commit comments

Comments
 (0)