warpx_max_grid_size=32)

smoother = picmi.BinomialSmoother(n_pass=1, compensation=True)
solver = picmi.ElectromagneticSolver(grid=grid,
                                     cfl=1.,
                                     method=em_solver_method,
                                     source_smoother=smoother)

# Diagnostics
# -----------
field_diag = picmi.FieldDiagnostic(name='diag1',
                                   grid=grid,
                                   period=100,
                                   warpx_plot_finepatch=1,
                                   warpx_plot_crsepatch=1)
part_diag = picmi.ParticleDiagnostic(name='diag1', period=100, species=[beam])

# Simulation setup
# -----------------

# Initialize the simulation object
# Note that the time step size is obtained from the solver
sim = picmi.Simulation(solver=solver, verbose=1)

# Inject the laser through an antenna
antenna = picmi.LaserAntenna(position=(0, 0, 9.e-6), normal_vector=(0, 0, 1.))
sim.add_laser(laser, injection_method=antenna)

# Add the plasma: continuously injected by the moving window
plasma_layout = picmi.GriddedLayout(
    grid=grid, n_macroparticle_per_cell=n_macroparticle_per_cell)
Ejemplo n.º 2
0
smoother = picmi.BinomialSmoother(n_pass=1, compensation=True)
solver = picmi.ElectromagneticSolver(grid=grid,
                                     cfl=1.,
                                     method=em_solver_method,
                                     source_smoother=smoother)

# Diagnostics
# -----------
field_diag = picmi.FieldDiagnostic(grid=grid,
                                   period=100,
                                   warpx_plot_raw_fields=1,
                                   warpx_plot_raw_fields_guards=1,
                                   warpx_plot_finepatch=1,
                                   warpx_plot_crsepatch=1)
part_diag = picmi.ParticleDiagnostic(period=100, species=[beam])

# Simulation setup
# -----------------

# Initialize the simulation object
# Note that the time step size is obtained from the solver
sim = picmi.Simulation(solver=solver, verbose=1)

# Inject the laser through an antenna
antenna = picmi.LaserAntenna(position=(0, 0, 9.e-6), normal_vector=(0, 0, 1.))
sim.add_laser(laser, injection_method=antenna)

# Add the plasma: continuously injected by the moving window
plasma_layout = picmi.GriddedLayout(
    grid=grid, n_macroparticle_per_cell=n_macroparticle_per_cell)