Beispiel #1
0
    #print "total avg JY=", sum(sum(sqrt(rpic.JYx * rpic.JYx + rpic.JYy*rpic.JYy)))

    #apply filters
    for sweeps in range(64):
        rpic.filter_current(0.5, 1)  #x sweep
        rpic.filter_current(0.5, 2)  #y sweep
    #rpic.filter_current(-1.0/6.0, 1) #put some power back with negative sweeps
    #rpic.filter_current(-1.0/6.0, 2)

    #I/O
    ##################################################
    if t > tgrid[ti]:
        A_xt[:, ti] = rpic.Ex[:, 0, 0]
        #A_xt[:,ti] = rpic.JYx[:,0,0]

        particles = rpic.collect_grid(rpic.mpiGrid)

        electrons, positrons = rpic.divide_species(particles)

        print "shape", shape(electrons)
        x = electrons[:, 0]
        y = electrons[:, 1]
        z = electrons[:, 2]
        vx = electrons[:, 3]
        vy = electrons[:, 4]
        vz = electrons[:, 5]
        res1a = ax1.plot(x, vx, "k.", alpha=0.8)

        x2 = positrons[:, 0]
        vx2 = positrons[:, 3]
        res1b = ax1.plot(x2, vx2, "b.", alpha=0.8)
Beispiel #2
0
    rpic.Vay_update_velocities(rpic.mpiGrid)
    
    rpic.sort_particles_between_cells(rpic.mpiGrid)

    #rpic.push_half_B()

    #rpic.push_E()

    rpic.deposit_current(rpic.mpiGrid)
    rpic.Yee_currents()

    #apply filters

    #I/O
    ################################################## 
    electrons = rpic.collect_grid(rpic.mpiGrid)
    x = electrons[:,0]
    y = electrons[:,1]
    z = electrons[:,2]
    vx = electrons[:,3]
    vy = electrons[:,4]
    vz = electrons[:,5]

    res1 = ax1.plot(x, vx, "k.")

    res2 = ax2.plot(XX[0,:,0], rpic.Ex[:,0,0], "b-")
    res3 = ax3.plot(XX[0,:,0], rpic.By[:,0,0], "b-")
    res3 = ax3.plot(XX[0,:,0], rpic.Bz[:,0,0], "r-")
    res4 = ax4.plot(XX[0,:,0], rpic.Jx[:,0,0], "b-")

    ax5 = slice_pdf(ax5, electrons)