Exemplo n.º 1
0
            # Print PES form and SUB PES Channels
            print('\nCalculating Rates for PES {}: {}, SUB PES {}'.format(
                pes_idx, formula, sub_pes_idx))
            for chn_idx, rxn in enumerate(rxn_lst):
                print('  Including Channel {}: {} = {}'.format(
                    rxn['chn_idx'],
                    '+'.join(rxn['reacs']),
                    '+'.join(rxn['prods'])))

            ktpdriver.run(
                formula, pes_idx, sub_pes_idx,
                SPC_DCT,
                CLA_DCT,
                THY_DCT,
                rxn_lst,
                PES_MODEL_DCT, SPC_MODEL_DCT,
                RUN_INP_DCT,
                write_messrate=WRITE_MESSRATE,
                run_messrate=RUN_MESSRATE,
                run_fits=RUN_FITS
            )
    else:
        print("Can't run kTPDriver without a PES being specified")

    printer.program_exit('ktp')

# Exit Program
print('\n\n')
printer.program_exit('amech')
Exemplo n.º 2
0
        transdriver.run(
            PES_RLST, SPC_RLST,
            TRANS_TSKS,
            SMOD_DCT,
            SPC_DCT, THY_DCT,
            INP_KEY_DCT['run_prefix'], INP_KEY_DCT['save_prefix']
        )
    ioprinter.program_exit('trans')

KTP_TSKS = TSK_LST_DCT.get('ktp')
if KTP_TSKS is not None:
    ioprinter.program_header('ktp')
    ktpdriver.run(
        PES_RLST,
        KTP_TSKS,
        SPC_DCT, GLOB_DCT,
        KMOD_DCT, SMOD_DCT,
        INP_KEY_DCT['run_prefix'], INP_KEY_DCT['save_prefix']
    )
    ioprinter.program_exit('ktp')

PROC_TSKS = TSK_LST_DCT.get('proc')
if PROC_TSKS is not None:
    ioprinter.program_header('proc')
    PES_IDX = None
    procdriver.run(
        PES_RLST, SPC_RLST,
        PROC_TSKS,
        SPC_DCT,
        KMOD_DCT, SMOD_DCT, THY_DCT,
        INP_KEY_DCT['run_prefix'], INP_KEY_DCT['save_prefix']
Exemplo n.º 3
0
            THY_DCT,
            INP_KEY_DCT['run_prefix'],
            INP_KEY_DCT['save_prefix'],
        )
    ioprinter.program_exit('trans')

KTP_TSKS = TSK_LST_DCT.get('ktp')
if KTP_TSKS is not None:
    ioprinter.program_header('ktp')
    ktpdriver.run(
        PES_RLST,
        INPUT['pesgrp'],
        KTP_TSKS,
        SPC_DCT,
        GLOB_DCT,
        THY_DCT,
        KMOD_DCT,
        SMOD_DCT,
        INP_KEY_DCT['run_prefix'],
        INP_KEY_DCT['save_prefix'],
        JOB_PATH,
    )
    ioprinter.program_exit('ktp')

PROC_TSKS = TSK_LST_DCT.get('proc')
if PROC_TSKS is not None:
    ioprinter.program_header('proc')
    procdriver.run(PES_RLST, SPC_RLST, PROC_TSKS, SPC_DCT, THY_DCT, KMOD_DCT,
                   SMOD_DCT, INP_KEY_DCT['run_prefix'],
                   INP_KEY_DCT['save_prefix'], JOB_PATH)
    ioprinter.program_exit('proc')
Exemplo n.º 4
0
def _mechdriver_main(tmp_dir):
    """ Copy of MechDriver bin
    """

    # print header message and host name (probably combine into one function)
    ioprinter.program_header('amech')
    ioprinter.random_cute_animal()
    ioprinter.host_name()

    # parse all of the input
    ioprinter.program_header('inp')

    inp_strs = ioparser.read_amech_input(tmp_dir)

    thy_dct = ioparser.thy.theory_dictionary(inp_strs['thy'])
    kmod_dct, smod_dct = ioparser.models.models_dictionary(
        inp_strs['mod'], thy_dct)
    inp_key_dct = ioparser.run.input_dictionary(inp_strs['run'])
    pes_idx_dct, spc_idx_dct = ioparser.run.chem_idxs(inp_strs['run'])
    tsk_lst_dct = ioparser.run.tasks(
        inp_strs['run'], inp_strs['mech'], thy_dct)
    spc_dct, glob_dct = ioparser.spc.species_dictionary(
        inp_strs['spc'], inp_strs['dat'], inp_strs['geo'], 'csv')
    pes_dct = ioparser.mech.pes_dictionary(
        inp_strs['mech'], 'chemkin', spc_dct)

    pes_rlst, spc_rlst = ioparser.rlst.run_lst(
        pes_dct, spc_dct, pes_idx_dct, spc_idx_dct)

    # build the run-save filesystem directories
    prefix_fs(inp_key_dct['run_prefix'], inp_key_dct['save_prefix'])

    # run drivers requested by user
    es_tsks = tsk_lst_dct.get('es')
    if es_tsks is not None:
        ioprinter.program_header('es')
        esdriver.run(
            pes_rlst, spc_rlst,
            es_tsks,
            spc_dct, glob_dct, thy_dct,
            inp_key_dct['run_prefix'], inp_key_dct['save_prefix']
        )
        ioprinter.program_exit('es')

    therm_tsks = tsk_lst_dct.get('thermo')
    if therm_tsks is not None:
        ioprinter.program_header('thermo')
        thermodriver.run(
            pes_rlst, spc_rlst,
            therm_tsks,
            kmod_dct, smod_dct,
            spc_dct, thy_dct,
            inp_key_dct['run_prefix'], inp_key_dct['save_prefix'], tmp_dir
        )
        ioprinter.program_exit('thermo')

    trans_tsks = tsk_lst_dct.get('trans')
    if trans_tsks is not None:
        ioprinter.program_header('trans')
        if pes_dct:
            transdriver.run(
                pes_rlst, spc_rlst,
                trans_tsks,
                smod_dct,
                spc_dct, thy_dct,
                inp_key_dct['run_prefix'], inp_key_dct['save_prefix']
            )
        ioprinter.program_exit('trans')

    ktp_tsks = tsk_lst_dct.get('ktp')
    if ktp_tsks is not None:
        ioprinter.program_header('ktp')
        ktpdriver.run(
            pes_rlst,
            ktp_tsks,
            spc_dct, glob_dct,
            kmod_dct, smod_dct,
            inp_key_dct['run_prefix'], inp_key_dct['save_prefix'], tmp_dir
        )
        ioprinter.program_exit('ktp')

    proc_tsks = tsk_lst_dct.get('proc')
    if proc_tsks is not None:
        ioprinter.program_header('proc')
        procdriver.run(
            pes_rlst, spc_rlst,
            proc_tsks,
            spc_dct, thy_dct,
            kmod_dct, smod_dct,
            inp_key_dct['run_prefix'], inp_key_dct['save_prefix'], tmp_dir
        )
        ioprinter.program_exit('proc')

    # exit program
    ioprinter.obj('vspace')
    ioprinter.program_exit('amech')
Exemplo n.º 5
0
                         THY_DCT,
                         RUN_SPC_LST_DCT,
                         RUN_INP_DCT,
                         ref_scheme='basic',
                         run_pf=bool('pf' in RUN_JOBS_LST),
                         run_thermo=bool('thermo' in RUN_JOBS_LST))

if 'rates' in RUN_JOBS_LST or 'params' in RUN_JOBS_LST:
    if RUN_OBJ_DCT['pes']:
        # Call kTPDriver for spc in each PES
        for pes_formula, rxn_lst in RUN_PES_DCT.items():
            # Get info for the transition states
            ts_dct = loadspc.build_sadpt_dct(rxn_lst, MODEL_DCT, THY_DCT,
                                             ES_TSK_STR, RUN_INP_DCT,
                                             RUN_OPTIONS_DCT, SPC_DCT, {})
            SPC_DCT.update(ts_dct)
            # Run the driver
            ktpdriver.run(pes_formula,
                          SPC_DCT,
                          THY_DCT,
                          rxn_lst,
                          MODEL_DCT,
                          RUN_INP_DCT,
                          run_rates=bool('rates' in RUN_JOBS_LST),
                          run_fits=bool('params' in RUN_JOBS_LST))
    else:
        print("Can't run kTPDriver without a PES being specified")

# Print the program exist message
print('AutoMech has completed. I hope you had fun!')