Initialization¶
-
lcode.
init
(config)[source]¶ Initialize all the arrays needed for
step
andconfig.beam
.This function performs quite a boring sequence of actions, outlined here for interlinking purposes:
- validates the oddity of
config.grid_steps
[Fields and densities grid], - validates that
config.reflect_padding_steps
is large enough [Reflect and ‘plasma’ boundaries], - calculates the
reflect_boundary
and monkey-patches it back intoconfig
, - initializes the
x
andy
arrays for use inconfig_example.beam()
, - calculates the plasma placement boundary,
- immediately passes it to
make_plasma()
, leaving it oblivious to the padding concerns, - performs the initial electrion deposition to obtain the background ions charge density [Background ions],
- groups the constant arrays into a
GPUArray
instanceconst
, and - groups the evolving arrays into a
GPUArray
instancestate
.
- validates the oddity of