Quickstart
To start running your first simulation using lcode, all you need to do is run these three commands:
pip install lcode
python -m lcode get original-ssm
python run.py
Explanation
First, you need to install the lcode package along with its dependencies.
If you want to work with a virtual environment, then you need to create and activate it beforehand.
# linux
python -m venv lcode-env
source lcode-env/bin/activate # linux
# Windows
python -m venv lcode-env
.\lcode-env\scripts\Activate
Then install lcode:
pip install lcode
lcode provides a tool for generating a few example files for running simulations. The ssm file provides the raw data for the simulation described in the article. The following command generates a run.py file that specifies all the simulation data:
python -m lcode get original-ssm
After generation, you can change the simulation parameters in the run.py file. More information about the parameters is given in the corresponding sections:
Configuration - About general simulation settings
Beam - About beam settings
Diagnostics - About selecting diagnostics
Simulation - About starting the simulation
Warning
If you want to use GPU, you need to install the cupy library yourself [Install Cupy].
Now all that’s left is to run the calculation:
python run.py