Exemplo n.º 1
0
def plain(args):
    wd = opt.work_dir
    opt.work_dir = wd + '/N{0:0>3x}_1'.format(opt.n)
    c0 = launch(opt, dt = 0.2/opt.n,
            particle_class = opt.particle_class,
            interpolator_class = opt.interpolator_class)
    c0.compute_statistics()
    print ('Re = {0:.0f}'.format(c0.statistics['Re']))
    print ('Rlambda = {0:.0f}'.format(c0.statistics['Rlambda']))
    print ('Lint = {0:.4e}, etaK = {1:.4e}'.format(c0.statistics['Lint'], c0.statistics['etaK']))
    print ('Tint = {0:.4e}, tauK = {1:.4e}'.format(c0.statistics['Tint'], c0.statistics['tauK']))
    print ('kMetaK = {0:.4e}'.format(c0.statistics['kMeta']))
    for s in range(c0.particle_species):
        acceleration_test(c0, species = s, m = 1)
    if not opt.multiplejob:
        return None
    assert(opt.niter_todo % 3 == 0)
    opt.work_dir = wd + '/N{0:0>3x}_2'.format(opt.n)
    opt.njobs *= 2
    opt.niter_todo = opt.niter_todo//2
    c1 = launch(opt, dt = c0.parameters['dt'],
            particle_class = opt.particle_class,
            interpolator_class = opt.interpolator_class)
    c1.compute_statistics()
    opt.work_dir = wd + '/N{0:0>3x}_3'.format(opt.n)
    opt.njobs = 3*opt.njobs//2
    opt.niter_todo = 2*opt.niter_todo//3
    c2 = launch(opt, dt = c0.parameters['dt'],
            particle_class = opt.particle_class,
            interpolator_class = opt.interpolator_class)
    c2.compute_statistics()
    compare_stats(opt, c0, c1)
    compare_stats(opt, c0, c2)
    return None
Exemplo n.º 2
0
    c1.compute_statistics()
    opt.work_dir = wd + '/N{0:0>3x}_3'.format(opt.n)
    opt.njobs = 3*opt.njobs//2
    opt.niter_todo = 2*opt.niter_todo//3
    c2 = launch(opt, dt = c0.parameters['dt'],
            particle_class = opt.particle_class,
            interpolator_class = opt.interpolator_class)
    c2.compute_statistics()
    compare_stats(opt, c0, c1)
    compare_stats(opt, c0, c2)
    return None

if __name__ == '__main__':
    c0 = NSPlain()
    c0.launch(
            ['-n', '32',
             '--ncpu', '4',
             '--nparticles', '1000',
             '--niter_todo', '48',
             '--wd', 'data/single'] +
            sys.argv[1:])
    c0.compute_statistics()
    print ('Re = {0:.0f}'.format(c0.statistics['Re']))
    print ('Rlambda = {0:.0f}'.format(c0.statistics['Rlambda']))
    print ('Lint = {0:.4e}, etaK = {1:.4e}'.format(c0.statistics['Lint'], c0.statistics['etaK']))
    print ('Tint = {0:.4e}, tauK = {1:.4e}'.format(c0.statistics['Tint'], c0.statistics['tauK']))
    print ('kMetaK = {0:.4e}'.format(c0.statistics['kMeta']))
    for s in range(c0.particle_species):
        acceleration_test(c0, species = s, m = 1)