OSHUN  beta
Arbitrary Order Spherical-Harmonic 1D-3P Vlasov-Fokker-Planck-Maxwell code
Time loop setup

The relevant parameters in the input deck are

$ t_{stop} $, $ n_{outsteps} $, $ clf_{dp} $. These correspond to the simulation end time in normalized units, the number of desired outputs, and the maximum time-step

$ t_{stop} / n_{outsteps} $ has to be an integer. If that is satisfied, the code enters a loop that goes from the 1st output step to the last. Within this loop, the goal is to have another loop such that OSHUN runs from beginning to end with a maximum time-step given by $ clf_{dp} $.

Numerically, it can be described by the following.

The first loop is given by

for (size_t t_{out}(tout_start + 1); t_{out} < n_{outsteps} + 1; ++t_{out})

where tout_start = 0. Therefore, the loop goes from output no. 1 to output no. $n_{outsteps}$. Within this loop, the following is performed

for (Clock W(t_{out} - 1, dt_{out}, CLF); W.tick() < W.numh(); ++W)

where $dt_{out} = t_{stop} / n_{outsteps}$.

The Clock function is responsible for determining the time step. First, it calculates the number of timesteps within each clock loop using $ numh = (dt_{out} / clf_{dp}) + 1$ to ensure that $clf_{dp} > timestep$. Using $numh$, the timestep is determined by $ h = dt_{out} / numh $.

This same Clock loop is performed $n_{outsteps}$ times.