Configuration (YAML input)
Note
See descriptions of input parameters in the WarpX PICMI documentation
A simulation is defined by a single YAML file passed as input_file. The
top level is a mapping with these sections:
Section |
Required |
Purpose |
|---|---|---|
|
yes |
Geometry, resolution, and boundary conditions |
|
yes |
Field solver (electromagnetic / -static / hybrid) |
|
yes |
Time stepping and global algorithm options |
|
no |
Applied / initial fields (list) |
|
no |
Laser pulses (list) — not yet implemented |
|
no |
Particle species (list) |
|
no |
Output diagnostics (list) |
Each section’s keys map directly onto the corresponding
PICMI object. Every value listed by that
PICMI class is accepted, including the warpx_* backend options; an unknown
key raises a ValueError that names the offending field. The accepted value
lists are also enumerated on warpx.warpx.WarpX.available.
grid
grid_type selects the geometry; the remaining keys are forwarded to the
matching PICMI grid class.
Valid grid_type values:
Cartesian3DGridCartesian2DGridCartesian1DGridCylindricalGrid
grid:
grid_type: Cartesian2DGrid
number_of_cells: [64, 128]
lower_bound: [-0.01, 0.0]
upper_bound: [0.01, 0.02]
lower_boundary_conditions: [dirichlet, dirichlet]
upper_boundary_conditions: [dirichlet, dirichlet]
lower_boundary_conditions_particles: [absorbing, absorbing]
upper_boundary_conditions_particles: [absorbing, absorbing]
warpx_potential_lo_z: 0.0
warpx_potential_hi_z: 150.0e3
Common keys include number_of_cells, lower_bound / upper_bound,
lower_boundary_conditions / upper_boundary_conditions (and the
_particles variants), electrode potentials (warpx_potential_lo_* /
warpx_potential_hi_*), warpx_max_grid_size, and warpx_blocking_factor.
Cylindrical grids additionally take nr, nz, and n_azimuthal_modes.
solver
solver_type selects both the PICMI solver class and its method:
|
Maps to |
|---|---|
|
Electromagnetic (FDTD) |
|
Electromagnetic (spectral) |
|
Electromagnetic |
|
Electrostatic (FFT) |
|
Electrostatic (FFT) |
|
Electrostatic (Multigrid) |
|
Electrostatic (Multigrid) |
|
Hybrid PIC |
The electrostatic suffixes pick the physics model automatically:
LF— labframe (standard)EMS— labframe electromagnetostatic (adds a magnetostatic solve)EP— labframe effective potentialRel— relativistic electrostatic
solver:
solver_type: ES_MLMG_EMS
required_precision: 1.0e-6
warpx_magnetostatic_required_precision: 1.0e-6
warpx_self_fields_verbosity: 0
Electromagnetic solvers accept cfl, stencil_order, and PML options;
electrostatic solvers accept required_precision, maximum_iterations,
and the warpx_magnetostatic_* / warpx_effective_potential_* options;
hybrid solvers accept Te, n0, plasma_resistivity, and substep
controls.
simulation
Time stepping and global algorithm selection. No *_type key — the keys map
directly onto pywarpx.picmi.Simulation.
simulation:
time_step_size: 1.0e-12
max_time: 3.0e-10
particle_shape: 1
Frequently used keys: time_step_size, max_steps, max_time,
particle_shape, gamma_boost, and the many warpx_* algorithm options
(deposition, gathering, pusher, load balancing, sorting, embedded boundary,
collisions, …). Verbosity is taken from the constructor’s verbose flag.
fields
A list of applied or initial fields. field_type selects the kind:
|
Description |
|---|---|
|
Initial E/B from analytic expressions |
|
Constant applied E/B |
|
Applied E/B from analytic expressions |
|
Load initial field from a file ( |
|
Plasma-lens array ( |
|
Field mirror |
fields:
- field_type: ConstantApplied
Bz: 0.5
- field_type: AnalyticApplied
Ez_expression: "1e5 * sin(z)"
species
A list of particle species. Each entry requires a distribution-type and a
layout; the remaining keys configure the species, its initial distribution,
and its particle layout.
Distributions (distribution-type):
GaussianBunch— needsn_physical_particles,rms_bunch_sizeUniform— needsdensityAnalytic— needsdensity_expressionUniformFlux/AnalyticFlux— surface emission; needflux,flux_normal_axis,surface_flux_position,flux_directionParticleList— explicitx/y/z/ux/uy/uz/weightFromFile— needsfile_path
Layouts (layout):
Gridded—n_macroparticle_per_cellPseudoRandom—n_macroparticles/n_macroparticles_per_cell/seed(required for flux injection)
species:
- particle_type: electron
name: electron
distribution-type: UniformFlux
flux: 6.241509e23
flux_normal_axis: z
surface_flux_position: 0.0
flux_direction: 1
flux_tmin: 0.0
flux_tmax: 2.0e-11
gaussian_flux_momentum_distribution: true
rms_velocity: [1.5e5, 1.5e5, 1.5e5]
layout: PseudoRandom
n_macroparticles_per_cell: 4
initialize_self_field: false
Tip
Use a standard species name (e.g. electron) so openPMD-beamphysics
can resolve the particle mass/charge for energy and kinetic-energy plots.
diagnostics
A list of output diagnostics. diagnostic_type selects the kind:
|
Required keys |
Notes |
|---|---|---|
|
|
Per-species particle dumps |
|
|
Field grids ( |
|
|
Time-averaged fields |
|
|
Electrostatic field grids |
|
|
Reduced (scalar) diagnostics |
|
|
Back-transformed particles |
|
|
Back-transformed fields |
diagnostics:
- diagnostic_type: Particle
name: diag1
period: 30
species: [electron]
- diagnostic_type: Field
name: diag_fields
period: 30
data_list: [phi, rho, Ex, Ez]
Important
Unless you override them, non-reduced diagnostics default to
warpx_format: openpmd with the h5 backend and are written to
<path>/diags. This is what the plotting and archiving helpers expect.
For a Particle / LabFrameParticle diagnostic, the species list
must reference species names you defined above.