Skip to content

Commit f0d626f

Browse files
committed
Copy the latest chemkin file to chem.inp
Whenever the latest chemXXXX.inp file is written, it is copied (or rather hard-linked) to chemkin/chem.inp, so that you can always just look at this file and get the latest.
1 parent 4a12a62 commit f0d626f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

rmg.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,12 @@ def execute(args):
343343

344344
# Save a Chemkin file containing the current model core
345345
logging.info('Saving latest model core to Chemkin file...')
346-
reactionModel.saveChemkinFile(os.path.join(settings.outputDirectory, 'chemkin', 'chem%04i.inp' % len(reactionModel.core.species)))
346+
this_chemkin_path = os.path.join(settings.outputDirectory, 'chemkin', 'chem%04i.inp' % len(reactionModel.core.species))
347+
latest_chemkin_path = os.path.join(settings.outputDirectory, 'chemkin','chem.inp')
348+
reactionModel.saveChemkinFile(this_chemkin_path)
349+
if os.path.exists(latest_chemkin_path):
350+
os.unlink(latest_chemkin_path)
351+
os.link(this_chemkin_path,latest_chemkin_path)
347352

348353
# Save the restart file if desired
349354
if settings.saveRestart:

0 commit comments

Comments
 (0)