Skip to content

Commit

Permalink
Reduced the unnecessary calls to calculateSymmetryNumber when calcula…
Browse files Browse the repository at this point in the history
…ting radical thermo.

calculateSymmetryNumber for saturated structure was called too frequently
when calculating entropy of radical.
  • Loading branch information
connie committed Sep 25, 2014
1 parent f5c3335 commit fc52803
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions rmgpy/data/thermo.py
Original file line number Diff line number Diff line change
Expand Up @@ -814,16 +814,13 @@ def estimateRadicalThermoViaHBI(self, molecule, stableThermoEstimator ):
saturatedStruct.updateLonePairs()
saturatedStruct.multiplicity = 1

# Get thermo estimate for saturated form of structure
thermoData = stableThermoEstimator(saturatedStruct)
# Get thermo estimate for saturated form of structure
thermoData = stableThermoEstimator(saturatedStruct)
if thermoData is None:
logging.info("Thermo data of saturated {0} of molecule {1} is None.".format(saturatedStruct, molecule))
return None
assert thermoData is not None, "Thermo data of saturated {0} of molecule {1} is None!".format(saturatedStruct, molecule)

# Undo symmetry number correction for saturated structure
# saturatedStruct.calculateSymmetryNumber()
# thermoData.S298.value_si += constants.R * math.log(saturatedStruct.symmetryNumber)
# Correct entropy for symmetry number of radical structure
molecule.calculateSymmetryNumber()
thermoData.S298.value_si -= constants.R * math.log(molecule.symmetryNumber)
Expand Down

0 comments on commit fc52803

Please sign in to comment.