Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tree generation improvements #1848

Merged
merged 4 commits into from
Dec 14, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions rmgpy/data/kinetics/family.py
Original file line number Diff line number Diff line change
Expand Up @@ -959,6 +959,9 @@ def save_groups(self, path):
f.write('reactantNum = {0}\n\n'.format(self.reactant_num))
if self.product_num is not None:
f.write('productNum = {0}\n\n'.format(self.product_num))

if self.auto_generated is not None:
f.write('autoGenerated = {0}\n\n'.format(self.auto_generated))

# Write the recipe
f.write('recipe(actions=[\n')
Expand Down Expand Up @@ -3798,10 +3801,12 @@ def fix_labels_mol(mol, root_labels):
if estimate_thermo:
for j, react in enumerate(r.item.reactants):
if rxns[i].reactants[j].thermo is None:
react.generate_resonance_structures()
rxns[i].reactants[j].thermo = tdb.get_thermo_data(react)

for j, react in enumerate(r.item.products):
if rxns[i].products[j].thermo is None:
react.generate_resonance_structures()
rxns[i].products[j].thermo = tdb.get_thermo_data(react)

rxns[i].kinetics = r.data
Expand Down Expand Up @@ -3877,7 +3882,9 @@ def fix_labels_mol(mol, root_labels):
if estimate_thermo:
for r in rrev.reactants:
if r.thermo is None:
r.thermo = tdb.get_thermo_data(deepcopy(r))
therm_spc = deepcopy(r)
therm_spc.generate_resonance_structures()
r.thermo = tdb.get_thermo_data(therm_spc)

rev_rxns.append(rrev)

Expand Down Expand Up @@ -3916,7 +3923,9 @@ def fix_labels_mol(mol, root_labels):
if estimate_thermo:
for r in rrev.reactants:
if r.thermo is None:
r.thermo = tdb.get_thermo_data(deepcopy(r))
therm_spc = deepcopy(r)
therm_spc.generate_resonance_structures()
r.thermo = tdb.get_thermo_data(therm_spc)
rxns[i] = rrev

if self.own_reverse and get_reverse:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@

reversible = True

autoGenerated = False

recipe(actions=[
['BREAK_BOND', '*2', 1, '*3'],
['FORM_BOND', '*1', 1, '*3'],
Expand Down
2 changes: 1 addition & 1 deletion scripts/generateTree.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def main():
path=dbdir,
thermo_libraries=['Klippenstein_Glarborg2016', 'BurkeH2O2', 'thermo_DFT_CCSDTF12_BAC', 'DFT_QCI_thermo',
'primaryThermoLibrary', 'primaryNS', 'NitrogenCurran', 'NOx2018', 'FFCM1(-)',
'SulfurLibrary', 'SulfurGlarborgH2S'],
'SulfurLibrary', 'SulfurGlarborgH2S', 'SABIC_aromatics'],
transport_libraries=[],
reaction_libraries=[],
seed_mechanisms=[],
Expand Down