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’.

step(N_steps=None)

Compute N time steps.

Parametrs

N_stepsint, optional

Number of time steps that will be made. Default : N_steps = time_limit / time_step.

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