|
11 | 11 | Otherwise, one can just type exit() |
12 | 12 | """ |
13 | 13 | # Import warp-specific packages |
14 | | -from warp_init_tools import * |
| 14 | +from warp.init_tools import * |
15 | 15 |
|
16 | 16 | # ----------------------------------------------------------------------------- |
17 | 17 | # Parameters (Modify the values below to suit your needs) |
|
59 | 59 | # Diagnostics |
60 | 60 | # ----------- |
61 | 61 | # Period of diagnostics (in number of timesteps) |
62 | | -diag_period = 100 |
| 62 | +diag_period = 25 |
63 | 63 | # Whether to write the fields |
64 | 64 | write_fields = 1 |
65 | 65 | # Whether to write the particles |
|
128 | 128 | # Number of macroparticles per cell in each direction |
129 | 129 | # In Circ, nppcelly is the number of particles along the |
130 | 130 | # azimuthal direction. Use a multiple of 4*circ_m |
131 | | -plasma_nx = 2 |
| 131 | +plasma_nx = 1 |
132 | 132 | plasma_ny = 4 |
133 | | -plasma_nz = 2 |
| 133 | +plasma_nz = 1 |
134 | 134 |
|
135 | 135 | # Plasma content and profile |
136 | 136 | # -------------------------- |
@@ -274,6 +274,7 @@ def beam_dens_func(x, y, z): |
274 | 274 | beam_nz, dim, circ_m ) |
275 | 275 | beam = Species(type=Electron, weight=beam_weight, name='beam') |
276 | 276 | # Set the numerical parameters only now: they affect the newly created species |
| 277 | +top.ssnpid = nextpid() |
277 | 278 | set_numerics( depos_order, efetch, particle_pusher, dim) |
278 | 279 |
|
279 | 280 | # Setup the field solver object |
@@ -322,13 +323,14 @@ def beam_dens_func(x, y, z): |
322 | 323 | if write_fields == 1: |
323 | 324 | diag1 = FieldDiagnostic( period=diag_period, top=top, w3d=w3d, em=em, |
324 | 325 | comm_world=comm_world, lparallel_output=parallel_output, |
325 | | - write_dir='./example-2d' ) |
| 326 | + write_dir='./example-2d', fieldtypes=["E", "rho"] ) |
326 | 327 | installafterstep( diag1.write ) |
327 | 328 | if write_particles == 1: |
328 | 329 | species_dict = { species.name : species for species in listofallspecies \ |
329 | 330 | if not( species.name in ["Hydrogen0+", "electron from Hydrogen"] )} |
330 | 331 | diag2 = ParticleDiagnostic( period=diag_period, top=top, w3d=w3d, |
331 | 332 | species=species_dict, write_dir='./example-2d', |
| 333 | + particle_data={"position","momentum","weighting","id"}, |
332 | 334 | comm_world=comm_world, lparallel_output=parallel_output ) |
333 | 335 | installafterstep( diag2.write ) |
334 | 336 |
|
|
0 commit comments