MKJacobianUtils

Main.MKJacobianUtils.get_electron_Jacobian_matrixMethod
get_electron_Jacobian_matrix(run_directory; restart_time_index=1,
                             restart_index=nothing,
                             include_z_advection=true,
                             include_vpa_advection=true,
                             include_electron_pdf_term=true,
                             include_dissipation=true,
                             include_krook=true,
                             include_external_source=true,
                             include_constraint_forcing=true,
                             include_energy_equation=true,
                             include_ion_dt_forcing=true)

Calculate and return a Jacobian matrix for the kinetic electron solve.

To use this function, first include the script containing it

include("util/MKJacobianUtils.jl")

then you can call the function.

To avoid extreme behaviour due to an arbitrary initial condition, this script expects to 'restart' from an existing simulation. By default it returns the Jacobian matrix that would be used at the start of the first ion timestep (after the initialisation stage where electrons are relaxed towards steady state treating the ions as a fixed background).

run_directory is the path to the directory where the run to 'restart' from is stored.

restart_time_index can be passed an integer value if you want the Jacobian for an output step other than the initial one. restart_time_index=-1 would give the final time point of the simulation in run_directory.

If there were multiple restarts of the simulation in run_directory, restart_index can be used to select which restart to read from. Reads from the latest one by default. Numerical values can only be used for restarts before the latest one - e.g. if the run was not restarted, restart_index=1 is not valid, only the default restart_index=nothing can be used.

The include_* arguments can be used to select which particular terms to include in the Jacobian. By default all terms are included.

source