Particles loaded are advanced one step with the default LeapFrog mover by callingEvery time the code is back at the interpreter particle positions and momenta/velocities are properly synched in the leapfrog advance cycle of the mover. In the 3D and r-z packages, top.dt defines the time advance step. In the x-y slice code, wxy.ds defines the axial slide advance step along the reference orbit. In the envelope code step() advances the envelope fully from env.zl to env.zu axial coordinates with step size env.dzenv.
This will advance particles loaded a single timestep specified by top.dt in all types of simulations other the the x-y slice code and envelope codes. In the slice code step() advances on axial distance step specified by top.ds along the reference orbit of the lattice. In the envelope code step() does a complete envelope advance. To advance nstep postitive integer steps call:
Numerous built-in "hooks" can be exploited to apply interpreter defined functions in the particle advance cycle without modifying compiled code. For example:
These can be used as in the following schematic example where one might want to call a particular diagnostic function after taking a step in the particle advance:
Then the diagnostic defined in my_diagnostic() will be called each step the simulation is advanced.