Beispiel #1
0
                     p_nt,
                     n_e,
                     dens_func=dens_func,
                     zmin=zmin,
                     initialize_ions=True,
                     v_comoving=v_comoving,
                     gamma_boost=gamma_boost,
                     n_order=n_order,
                     boundaries='open',
                     use_cuda=use_cuda)

    # Add an electron bunch
    add_elec_bunch(sim,
                   bunch_gamma,
                   bunch_n,
                   bunch_zmin,
                   bunch_zmax,
                   0,
                   bunch_rmax,
                   boost=boost)
    if track_bunch:
        sim.ptcl[2].track(sim.comm)

    # Add a laser to the fields of the simulation
    add_laser(sim,
              a0,
              w0,
              ctau,
              z0,
              lambda0=lambda0,
              zf=zfoc,
              gamma_boost=gamma_boost)
Beispiel #2
0
                     p_nr,
                     p_nt,
                     n_e,
                     dens_func=dens_func,
                     zmin=zmin,
                     initialize_ions=True,
                     v_comoving=-0.9999 * c,
                     use_galilean=False,
                     n_guard=n_guard,
                     exchange_period=exchange_period,
                     gamma_boost=gamma_boost,
                     boundaries='open',
                     use_cuda=use_cuda)

    # Add an electron bunch
    add_elec_bunch(sim, bunch_gamma, bunch_n, bunch_zmin, bunch_zmax, 0,
                   bunch_rmax)
    if track_bunch:
        sim.ptcl[2].track(sim.comm)

    # Add a laser to the fields of the simulation
    add_laser(sim,
              a0,
              w0,
              ctau,
              z0,
              lambda0=lambda0,
              zf=zfoc,
              gamma_boost=gamma_boost)

    # Configure the moving window
    sim.set_moving_window(v=v_window, gamma_boost=gamma_boost)
Beispiel #3
0
                 n_e,
                 n_order=n_order,
                 v_comoving=-0.999999 * c,
                 use_galilean=True)

# Configure the moving window
#sim.moving_win = MovingWindow( sim.fld.interp[0],
#                               ncells_damp=2,
#                               ncells_zero=2 )

# Suppress the particles that were intialized by default and add the bunch
sim.ptcl = []
add_elec_bunch(sim,
               gamma0,
               n_e,
               p_zmin,
               p_zmax,
               p_rmin,
               p_rmax,
               direction='backward')

# Show the initial fields
plt.figure(0)
sim.fld.interp[0].show('Ez')
plt.figure(1)
sim.fld.interp[0].show('Er')
plt.show()
print('Done')

# Carry out the simulation
for k in range(N_step / N_show):
    sim.step(N_show, correct_currents=False, use_true_rho=False)
Beispiel #4
0
                 p_nz,
                 p_nr,
                 p_nt,
                 n_e,
                 n_order=n_order,
                 boundaries={
                     'z': 'open',
                     'r': 'reflective'
                 })

# Configure the moving window
sim.set_moving_window(v=c)

# Suppress the particles that were intialized by default and add the bunch
sim.ptcl = []
add_elec_bunch(sim, gamma0, n_e, p_zmin, p_zmax, p_rmin, p_rmax)

# Show the initial fields
plt.figure(0)
plt.imshow(sim.fld.interp[0].Ez.real)
plt.figure(1)
plt.imshow(sim.fld.interp[0].Er.real)
plt.show()
print('Done')

# Carry out the simulation
for k in range(round(N_step / N_show)):
    sim.step(N_show)

    plt.figure(0)
    plt.clf()