Get started

If you want to reach out to contributors and users, please consider joining the chat, see Join the community.

See the Build/install HiPACE++ section to install the code locally or on your favorite platform.

A full HiPACE++ input file can be found below, with a detailed description of the main parameters. All the input parameters available in the simulation are available in the Input parameters section.

### AMReX parameters
################################
amr.n_cell = 64 64 100                  # number of grid points in x, y, z
amr.max_level = 0                       # level of mesh refinement. Currently, only 0 available

#### General simulation settings
################################
max_step = 20                           # max time step. 0 computes the fields of the initial beam
diagnostic.output_period = 1                # output period. Last step is always written
hipace.normalized_units = 1             # unit system: SI units: 0, normalized units: 1
hipace.dt = 4.4                         # Time step

### Simulation domain
################################
geometry.is_periodic =  1     1     0   # Is periodic?
geometry.prob_lo     = -8.   -8.   -6   # physical domain: dimension must be provided
geometry.prob_hi     =  8.    8.    6   # in the respective unit system

### Beam(s)
################################
beams.names = beam                      # name(s) of the beam(s)
beam.injection_type = fixed_weight      # injection type: fixed_weight, fixed_ppc, or from_file
beam.num_particles = 100000             # number of constant weight particles
beam.position_mean = 0. 0. 0            # mean position in x,y,z in the respective unit system
beam.position_std = 0.3 0.3 1.41        # rms size in x,y,z in the respecitve unit system
beam.density = 3.                       # peak density
beam.u_mean = 0. 0. 2000                # normalized mean momentum in x,y,z
beam.u_std = 0. 0. 0.                   # normalized rms of the momentum in x,y,z

### Plasma
################################
plasmas.names = plasma                  # name(s) of the plasma(s)
plasma.element = electron               # type of plasma: electron, proton, or an element e.g. He
plasma.density(x,y,z) = 1.              # density function in the respective unit systems
plasma.ppc = 1 1                        # particles per cell in x,y

### Diagnostics
################################
diagnostic.diag_type = xz               # 2D xz slice output. Options: xyz, xz, yz

This input file is inputs_normalized in examples/get_started/, which is the recommended place to start running a first simulation.

After compiling HiPACE++ from the HiPACE++ root directory, execute

cd examples/get_started/
../../build/bin/hipace inputs_normalized # run the simulation

Then you can use the openPMD-viewer to read the simulation output data. Directory examples/get_started/ also contains this example notebook. Reading the simulation output only takes these few Python commands:

# import statements
import numpy as np
import matplotlib.pyplot as plt
from openpmd_viewer import OpenPMDTimeSeries
# Read the simulation data
ts = OpenPMDTimeSeries('./diags/hdf5/')
# Get beam and field data at iteration 20
iteration = 20
x, z = ts.get_particle(species='beam', iteration=iteration, var_list=['x', 'z'])
F, m = ts.get_field(field='Ez', iteration=iteration)

Also please have a look at the production runs for beam-driven and laser-driven wakefield:

Both use realistic resolutions and run well on modern GPUs (as an estimate, each should take less than 5 min on 16 modern GPUs, e.g., NVIDIA A100).

Additional examples can be found in examples/.