def loadChemistryModel(self, resultsDir): print "Loading chemistry from", resultsDir ctifile = os.path.join(resultsDir, "chemkin", "chem.cti") base = os.path.basename(ctifile) root, ext = os.path.splitext(base) ctml.dataset(root) if not _species: execfile(ctifile) else: print "Already had chemistry loaded! If you want different chemistry please restart your python shell"
def loadCanteraFile(filepath): """Load a Cantera input (.cti) file. Returns a CoreEdgeReactionModel""" import os logging.info("Loading Cantera file %s"%filepath) logging.debug("which is located at %s"%os.path.abspath(filepath)) base = os.path.basename(filepath) root, ext = os.path.splitext(base) cti.dataset(root) assert not _species, "Problem: There's already cantera species info in memory." try: execfile(filepath) except NameError, error: # python 2.5 syntax logging.exception("RMG's cantera interpreter can't read this cti file." + error.message.lstrip('name ')) raise