Skip to content

Commit d707603

Browse files
committed
change is_molecule_forbidden
1 parent 471c9b4 commit d707603

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
@@ -1531,11 +1531,22 @@ def is_molecule_forbidden(self, molecule):
15311531
return True
15321532

15331533
# forbid vdw multi-dentate molecules for surface families
1534+
surface_sites = []
15341535
if "surface" in self.label.lower():
1535-
if molecule.get_num_atoms('X') > 1:
1536-
for atom in molecule.atoms:
1537-
if atom.atomtype.label == 'Xv':
1538-
return True
1536+
if "surface_monodentate_to_vdw_bidentate" in self.label.lower() and molecule.get_num_atoms('X') > 1:
1537+
surface_sites = [atom.atomtype.label for atom in molecule.atoms if 'X' in atom.atomtype.label]
1538+
if all(site == 'Xv' for site in surface_sites):
1539+
return True
1540+
else:
1541+
if molecule.get_num_atoms('X') > 1:
1542+
for atom in molecule.atoms:
1543+
if atom.atomtype.label == 'Xv':
1544+
return True
1545+
# elif "surface" in self.label.lower():
1546+
# if molecule.get_num_atoms('X') > 1:
1547+
# for atom in molecule.atoms:
1548+
# if atom.atomtype.label == 'Xv':
1549+
# return True
15391550

15401551
return False
15411552

rmgpy/molecule/molecule.py

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

6262
################################################################################
6363

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

6666
globals().update({
6767
'bond_orders': bond_orders,
@@ -2882,6 +2882,8 @@ def get_desorbed_molecules(self):
28822882
bonded_atom.increment_radical()
28832883
bonded_atom.increment_lone_pairs()
28842884
bonded_atom.label = '*4'
2885+
elif bond.is_van_der_waals():
2886+
bonded_atom.label = '*5'
28852887
else:
28862888
raise NotImplementedError("Can't remove surface bond of type {}".format(bond.order))
28872889
desorbed_molecule.remove_atom(site)

0 commit comments

Comments
 (0)