Simulation
A typical simulation run is organized using the Simulation class. It contains all information about plasma and beam parameters, solver configuration and required diagnostics.
- class lcode.Simulation
Top-level lcodePy simulation class that controls computational.
This class contains configuration of simulation and controls diagnostics.
- __init__(config, beam_parametrs, diagnostics, runas_filename)
Initializes a simulation.
Parametrs
- configdict, optional
The set of basic parameters to perform the simulation.
Default : lcode.config.default_config_values.
- beam_parametrsdict, otianal
Configuration of the charged particle beam.
The beam is disabled by default.
- diagnosticslist, optianal
A set of diagnostics to be activated.
All diagnostics are disabled by default.
- runas_filenamestr, optional
File name for saving the submitted simulation parameters.
Default : ‘runas.py’.
Example:
from lcode import Simulation # import
### set simulation parametrs
config = {
'geometry': 'circ',
'time-limit': 100,
'time-step': 10,
}
beam = {'current': 0.1}
###
sim = Simulation(config=config, beam_parameters=beam) # init simulation
sim.step() # run simulation