コード例 #1
0
ファイル: driver.py プロジェクト: katyhuff/pyrk
def main(args, curr_dir):
    np.set_printoptions(precision=5, threshold=np.inf)
    logger.set_up_pyrklog(args.logfile)
    infile = load_infile(args.infile)
    out_db = database.Database(filepath=args.outfile)
    if not hasattr(infile, 'n_ref'):
        n_ref = 0
    else:
        n_ref = infile.n_ref
    si = sim_info.SimInfo(timer=infile.ti,
                          components=infile.components,
                          iso=infile.fission_iso,
                          e=infile.spectrum,
                          n_precursors=infile.n_pg,
                          n_decay=infile.n_dg,
                          n_fic=n_ref,
                          kappa=infile.kappa,
                          feedback=infile.feedback,
                          rho_ext=infile.rho_ext,
                          plotdir=args.plotdir,
                          infile=args.infile,
                          db=out_db)
    # TODO: think about weather to add n_ref to all input files, or put n_ref in
    # database files
    print_logo(curr_dir)
    sol = solve(si=si, y=si.y, infile=infile)
    log_results(si)
    out_db.close_db()
    pyrklog.critical("\nSimulation succeeded.\n")
コード例 #2
0
def main(args, curr_dir):
    np.set_printoptions(precision=5, threshold=np.inf)
    logger.set_up_pyrklog(args.logfile)
    infile = load_infile(args.infile)
    out_db = database.Database(filepath=args.outfile)
    if not hasattr(infile, 'n_ref'):
        n_ref = 0
    else:
        n_ref = infile.n_ref
    si = sim_info.SimInfo(timer=infile.ti,
                          components=infile.components,
                          iso=infile.fission_iso,
                          e=infile.spectrum,
                          n_precursors=infile.n_pg,
                          n_decay=infile.n_dg,
                          n_fic=n_ref,
                          kappa=infile.kappa,
                          feedback=infile.feedback,
                          rho_ext=infile.rho_ext,
                          plotdir=args.plotdir,
                          infile=args.infile,
                          db=out_db)
    # TODO: think about weather to add n_ref to all input files, or put n_ref in
    # database files
    print_logo(curr_dir)
    sol = solve(si=si, y=si.y, infile=infile)
    log_results(si)
    out_db.close_db()
    pyrklog.critical("\nSimulation succeeded.\n")
コード例 #3
0
ファイル: driver.py プロジェクト: katyhuff/pyrk
def print_logo(curr_dir):
    filename = os.path.join(curr_dir, 'logo.txt')
    with open(filename, 'r') as logo:
        pyrklog.critical("\nWelcome to PyRK.\n" +
                         "(c) Kathryn D. Huff\n" +
                         "Your simulation is starting.\n" +
                         "Perhaps it's time for a coffee.\n" +
                         logo.read())
コード例 #4
0
ファイル: driver.py プロジェクト: archphy/pyrk
def main(args, curr_dir):
    np.set_printoptions(precision=5, threshold=np.inf)
    logger.set_up_pyrklog(args.logfile)
    infile = importlib.import_module(args.infile)

    si = sim_info.SimInfo(timer=infile.ti,
                          components=infile.components,
                          iso=infile.fission_iso,
                          e=infile.spectrum,
                          n_precursors=infile.n_pg,
                          n_decay=infile.n_dg,
                          kappa=infile.kappa,
                          feedback=infile.feedback,
                          rho_ext=infile.rho_ext,
                          plotdir=args.plotdir)
    print_logo(curr_dir)
    sol = solve(si=si, y=si.y, infile=infile)
    log_results(si)
    plotter.plot(sol, si)
    pyrklog.critical("\nSimulation succeeded.\n")
コード例 #5
0
def print_logo(curr_dir):
    filename = os.path.join(curr_dir, 'logo.txt')
    with open(filename, 'r') as logo:
        pyrklog.critical("\nWelcome to PyRK.\n" + "(c) Kathryn D. Huff\n" +
                         "Your simulation is starting.\n" +
                         "Perhaps it's time for a coffee.\n" + logo.read())