Initialization

lcode.init(config)[source]

Initialize all the arrays needed for step and config.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 into config,
  • initializes the x and y arrays for use in config_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 instance const, and
  • groups the evolving arrays into a GPUArray instance state.