How to run the code¶
Once installed (see Installation), FBPIC is available as a Python module on your system. Thus, a simulation is setup by creating a Python script that imports and uses FBPIC’s functionalities.
You can download examples of FBPIC scripts below (which you can then modify to suit your needs):
- Standard simulation of laser-wakefield acceleration:
- Boosted-frame simulation of laser-wakefield acceleration:
The different FBPIC objects that are used in the simulation scripts are defined in the section API reference.
Running and visualizing the simulation¶
The simulation is then run by typing
fbpic_script.py should be replaced by the name of your
Python script: either
boosted_frame_script.py for the above examples.
conda install -c rlehe openpmd_viewer
And then type
and follow the instructions in the notebook that pops up. (NB: the notebook only shows some of the capabilities of the openPMD-viewer. To learn more, see the tutorial notebook on the Github repository of openPMD-viewer).