Esempio n. 1
0
    axs.append(plt.subplot(gs[1, 0]))
    axs.append(plt.subplot(gs[2, 0]))

    ##################################################
    # node configuration
    conf = Conf()

    node = plasma.Grid(conf.Nx, conf.Ny)
    xmin = 0.0
    xmax = conf.dx * conf.Nx * conf.NxMesh
    ymin = 0.0
    ymax = conf.dy * conf.Ny * conf.NyMesh

    node.setGridLims(xmin, xmax, ymin, ymax)

    init.loadCells(node, conf)

    ##################################################
    # load values into cells
    injector.inject(node, filler, conf)

    insert_em(node, conf)

    #visualize initial condition
    plotAll(axs, node, conf, 0)

    vsol = pdev.AmrMomentumLagrangianSolver()

    print("solving momentum space push")
    cid = node.cellId(0, 0)
    cell = node.getCellPtr(cid)
Esempio n. 2
0
    #conf = Configuration('config-plasmaosc.ini')
    #conf = Configuration('config-dispersion.ini')

    grid = plasma.Grid(conf.Nx, conf.Ny)

    xmin = 0.0
    xmax = conf.dx * conf.Nx * conf.NxMesh
    ymin = 0.0
    ymax = conf.dy * conf.Ny * conf.NyMesh

    grid.set_grid_lims(xmin, xmax, ymin, ymax)

    #grid.initMpi()
    #loadMpiXStrides(grid)

    init.loadCells(grid, conf)

    ##################################################
    # Path to be created
    #if grid.master:
    if True:
        if not os.path.exists(conf.outdir):
            os.makedirs(conf.outdir)

    ##################################################
    # initialize
    Nx = conf.Nx * conf.NxMesh
    modes = np.arange(Nx)
    #modes        = np.array([2])
    random_phase = np.random.rand(len(modes))