From 5dae781b574b6c09cc9a91c2e2f40812eabd4a37 Mon Sep 17 00:00:00 2001 From: Mark Payne Date: Tue, 16 Oct 2018 18:54:04 -0400 Subject: [PATCH] Save sensitivity files for all species by specifying 'all' --- rmgpy/rmg/input.py | 10 +++++++--- rmgpy/rmg/main.py | 3 +++ rmgpy/tools/loader.py | 3 ++- rmgpy/tools/simulate.py | 2 ++ 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/rmgpy/rmg/input.py b/rmgpy/rmg/input.py index 8f8c3ed26f..21e74b9363 100644 --- a/rmgpy/rmg/input.py +++ b/rmgpy/rmg/input.py @@ -193,9 +193,13 @@ def simpleReactor(temperature, sensitiveSpecies = [] if sensitivity: - if isinstance(sensitivity, str): sensitivity = [sensitivity] - for spec in sensitivity: - sensitiveSpecies.append(speciesDict[spec]) + if sensitivity != 'all': + if isinstance(sensitivity, str): sensitivity = [sensitivity] + for spec in sensitivity: + sensitiveSpecies.append(speciesDict[spec]) + + else: + sensitiveSpecies.append('all') if not isinstance(T,list): sensitivityTemperature = T diff --git a/rmgpy/rmg/main.py b/rmgpy/rmg/main.py index 75454cb32b..fdfcbaf752 100644 --- a/rmgpy/rmg/main.py +++ b/rmgpy/rmg/main.py @@ -896,6 +896,9 @@ def execute(self, **kwargs): if reactionSystem.sensitiveSpecies and reactionSystem.sensConditions: logging.info('Conducting sensitivity analysis of reaction system %s...' % (index+1)) + + if reactionSystem.sensitiveSpecies == ['all']: + reactionSystem.sensitiveSpecies = self.reactionModel.core.species sensWorksheet = [] for spec in reactionSystem.sensitiveSpecies: diff --git a/rmgpy/tools/loader.py b/rmgpy/tools/loader.py index 2f0758fb26..7e15b1cdce 100644 --- a/rmgpy/tools/loader.py +++ b/rmgpy/tools/loader.py @@ -108,7 +108,8 @@ def loadRMGPyJob(inputFile, chemkinFile=None, speciesDict=None, generateImages=T for t in reactionSystem.termination: if isinstance(t, TerminationConversion): t.species = speciesDict[t.species] - reactionSystem.sensitiveSpecies = [speciesDict[spec] for spec in reactionSystem.sensitiveSpecies] + if reactionSystem.sensitiveSpecies != ['all']: + reactionSystem.sensitiveSpecies = [speciesDict[spec] for spec in reactionSystem.sensitiveSpecies] # Set reaction model to match model loaded from Chemkin file rmg.reactionModel.core.species = speciesList diff --git a/rmgpy/tools/simulate.py b/rmgpy/tools/simulate.py index 3da1b14d0a..1f47670ed9 100644 --- a/rmgpy/tools/simulate.py +++ b/rmgpy/tools/simulate.py @@ -90,6 +90,8 @@ def simulate(rmg, diffusionLimited=True): if reactionSystem.sensitiveSpecies: logging.info('Conducting simulation and sensitivity analysis of reaction system %s...' % (index+1)) + if reactionSystem.sensitiveSpecies == ['all']: + reactionSystem.sensitiveSpecies = rmg.reactionModel.core.species else: logging.info('Conducting simulation of reaction system %s...' % (index+1))