Skip to content

Commit

Permalink
Merge pull request #2155 from ReactionMechanismGenerator/assorted_tre…
Browse files Browse the repository at this point in the history
…e_gen_support

Assorted Tree Generation Support
  • Loading branch information
mjohnson541 authored Jun 14, 2021
2 parents 80d8af9 + f136331 commit 7f785d3
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
2 changes: 2 additions & 0 deletions rmgpy/data/kinetics/family.py
Original file line number Diff line number Diff line change
Expand Up @@ -3386,6 +3386,8 @@ def rxnkey(rxn):
min_splitable_entry_num=min_splitable_entry_num, min_rxns_to_spawn=min_rxns_to_spawn, extension_iter_max=extension_iter_max,
extension_iter_item_cap=extension_iter_item_cap)
logging.error("built tree with {} nodes".format(len(list(self.groups.entries))))

self.auto_generated = True

def get_rxn_batches(self, rxns, T=1000.0, max_batch_size=800, outlier_fraction=0.02, stratum_num=8):
"""
Expand Down
6 changes: 4 additions & 2 deletions rmgpy/molecule/element.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,7 @@ def get_element(value, isotope=-1):
# if a sourced value becomes available
# (C,C,2.5) is C#C - (CbenzeneC - C-C)
# P=P value is from: https://www2.chemistry.msu.edu/faculty/reusch/OrgPage/bndenrgy.htm
# C#S is the value for [C+]#[S-] from 10.1002/chem.201002840 referenced relative to 0 K
# The reference state is gaseous state at 298 K, but some of the values in the bde_dict might be coming from 0 K.
# The bond dissociation energy at 298 K is greater than the bond dissociation energy at 0 K by 0.6 to 0.9 kcal/mol
# (between RT and 3/2 RT), and this difference is usually much smaller than the uncertainty in the bond dissociation
Expand All @@ -348,7 +349,8 @@ def get_element(value, isotope=-1):
('C', 'N', 3): (887.0, 'kJ/mol'), ('C', 'O', 1): (358.0, 'kJ/mol'),
('C', 'O', 2): (799.0, 'kJ/mol'), ('C', 'O', 3): (1072.0, 'kJ/mol'),
('C', 'P', 1): (264.0, 'kJ/mol'), ('C', 'S', 1): (272.0, 'kJ/mol'),
('C', 'S', 2): (573.0, 'kJ/mol'), ('C', 'F', 1): (485.0, 'kJ/mol'),
('C', 'S', 2): (573.0, 'kJ/mol'), ('C', 'S', 3): (709.6, 'kJ/mol'),
('C', 'F', 1): (485.0, 'kJ/mol'),
('C', 'Cl', 1): (327.0, 'kJ/mol'), ('C', 'Br', 1): (285.0, 'kJ/mol'),
('C', 'I', 1): (213.0, 'kJ/mol'),
('Si', 'Si', 1): (222.0, 'kJ/mol'), ('Si', 'N', 1): (355.0, 'kJ/mol'),
Expand All @@ -358,7 +360,7 @@ def get_element(value, isotope=-1):
('N', 'N', 1): (167.0, 'kJ/mol'), ('N', 'N', 2): (418.0, 'kJ/mol'),
('N', 'N', 3): (942.0, 'kJ/mol'), ('N', 'O', 1): (201.0, 'kJ/mol'),
('N', 'O', 2): (607.0, 'kJ/mol'), ('N', 'F', 1): (283.0, 'kJ/mol'),
('N', 'Cl', 1): (313.0, 'kJ/mol'),
('N', 'Cl', 1): (313.0, 'kJ/mol'), ('N', 'S', 1): (467.0, 'kJ/mol'),
('O', 'O', 1): (142.0, 'kJ/mol'), ('O', 'O', 2): (494.0, 'kJ/mol'),
('O', 'P', 1): (335.0, 'kJ/mol'), ('O', 'P', 2): (544.0, 'kJ/mol'),
('O', 'S', 1): (265.0, 'kJ/mol'), ('O', 'S', 2): (522.0, 'kJ/mol'),
Expand Down
4 changes: 2 additions & 2 deletions rmgpy/molecule/group.py
Original file line number Diff line number Diff line change
Expand Up @@ -1294,7 +1294,7 @@ def get_extensions(self, r=None, basename='', atm_ind=None, atm_ind2=None, n_spl
r = elements.bde_elements # set of possible r elements/atoms
r = [ATOMTYPES[x] for x in r]

r_bonds = [1, 2, 3, 1.5]
r_bonds = [1, 2, 3, 1.5, 4]
r_un = [0, 1, 2, 3]

RnH = r[:]
Expand Down Expand Up @@ -1600,7 +1600,7 @@ def specify_bond_extensions(self, i, j, basename, r_bonds):
grps = []
label_list = []
Rbset = set(r_bonds)
bdict = {1: '-', 2: '=', 3: '#', 1.5: '-='}
bdict = {1: '-', 2: '=', 3: '#', 1.5: '-=', 4: '$'}
for bd in r_bonds:
grp = deepcopy(self)
grpc = deepcopy(self)
Expand Down
8 changes: 4 additions & 4 deletions rmgpy/molecule/groupTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -828,17 +828,17 @@ def test_generate_extensions(self):
""")

ans = [
'1 *2 C u0 r0 {2,[S,D]} {4,[S,D,T,B]}\n2 *1 C u[0,1] {1,[S,D]} {3,S}\n3 R!H u0 r1 {2,S}\n4 R!H ux {1,[S,D,T,B]}\n',
'1 *2 C u0 r0 {2,[S,D]} {4,[S,D,T,B,Q]}\n2 *1 C u[0,1] {1,[S,D]} {3,S}\n3 R!H u0 r1 {2,S}\n4 R!H ux {1,[S,D,T,B,Q]}\n',
'1 *2 C u0 r0 {2,[S,D]}\n2 *1 C u0 {1,[S,D]} {3,S}\n3 R!H u0 r1 {2,S}\n',
'1 *2 C u0 r0 {2,[S,D]}\n2 *1 C u1 {1,[S,D]} {3,S}\n3 R!H u0 r1 {2,S}\n',
'1 *2 C u0 r0 {2,[S,D]}\n2 *1 C u[0,1] r1 {1,[S,D]} {3,S}\n3 R!H u0 r1 {2,S}\n',
'1 *2 C u0 r0 {2,[S,D]}\n2 *1 C u[0,1] {1,[S,D]} {3,S} {4,[S,D,T,B]}\n3 R!H u0 r1 {2,S}\n4 R!H ux {2,[S,D,T,B]}\n',
'1 *2 C u0 r0 {2,[S,D]}\n2 *1 C u[0,1] {1,[S,D]} {3,S} {4,[S,D,T,B,Q]}\n3 R!H u0 r1 {2,S}\n4 R!H ux {2,[S,D,T,B,Q]}\n',
'1 *2 C u0 r0 {2,S}\n2 *1 C u[0,1] {1,S} {3,S}\n3 R!H u0 r1 {2,S}\n',
'1 *2 C u0 r0 {2,D}\n2 *1 C u[0,1] {1,D} {3,S}\n3 R!H u0 r1 {2,S}\n',
'1 *2 C u0 r0 {2,[S,D]}\n2 *1 C u[0,1] {1,[S,D]} {3,S}\n3 C u0 r1 {2,S}\n',
'1 *2 C u0 r0 {2,[S,D]}\n2 *1 C u[0,1] {1,[S,D]} {3,S}\n3 O u0 r1 {2,S}\n',
'1 *2 C u0 r0 {2,[S,D]}\n2 *1 C u[0,1] {1,[S,D]} {3,S}\n3 R!H u0 r1 {2,S} {4,[S,D,T,B]}\n4 R!H ux {3,[S,D,T,B]}\n',
'1 *2 C u0 r0 {2,[S,D]} {3,[S,D,T,B]}\n2 *1 C u[0,1] {1,[S,D]} {3,S}\n3 R!H u0 r1 {1,[S,D,T,B]} {2,S}\n'
'1 *2 C u0 r0 {2,[S,D]}\n2 *1 C u[0,1] {1,[S,D]} {3,S}\n3 R!H u0 r1 {2,S} {4,[S,D,T,B,Q]}\n4 R!H ux {3,[S,D,T,B,Q]}\n',
'1 *2 C u0 r0 {2,[S,D]} {3,[S,D,T,B,Q]}\n2 *1 C u[0,1] {1,[S,D]} {3,S}\n3 R!H u0 r1 {1,[S,D,T,B,Q]} {2,S}\n'
]
ans = [Group().from_adjacency_list(k) for k in ans]

Expand Down

0 comments on commit 7f785d3

Please sign in to comment.