utils

moment_kinetics.utils.get_CFLFunction
get_CFL!(CFL, speed, coord)

Calculate the CFL factor 'speed/(grid spacing)' (with no prefactor) corresponding to advection speed speed for advection. Note that moment_kinetics is set up so that dimension in which advection happens is the first dimension of speed - coord is the coordinate corresponding to this dimension.

The result is written in CFL. This function is only intended to be used in post-processing.

source
moment_kinetics.utils.get_default_restart_filenameMethod
get_default_restart_filename(io_input, prefix; error_if_no_file_found=true)

Get the default name for the file to restart from, using the input from io_input.

prefix gives the type of file to open, e.g. "moments", "dfns", or "initial_electron".

If no matching file is found, raise an error unless error_if_no_file_found=false is passed, in which case no error is raised and instead the function returns nothing.

source
moment_kinetics.utils.get_minimum_CFL_neutral_vzMethod
get_minimum_CFL_neutral_vz(speed, vz)

Calculate the minimum (over a shared-memory block) of the CFL factor 'speed/(grid spacing)' (with no prefactor) corresponding to advection speed speed for advection of neutrals in the vz direction.

Reduces the result over the shared-memory block (handling distributed parallelism is left to the calling site). The result is only to be used on rank-0 of the shared-memory block.

source
moment_kinetics.utils.get_minimum_CFL_neutral_zMethod
get_minimum_CFL_neutral_z(speed, z)

Calculate the minimum (over a shared-memory block) of the CFL factor 'speed/(grid spacing)' (with no prefactor) corresponding to advection speed speed for advection of neutrals in the z direction.

Reduces the result over the shared-memory block (handling distributed parallelism is left to the calling site). The result is only to be used on rank-0 of the shared-memory block.

source
moment_kinetics.utils.get_minimum_CFL_vpaMethod
get_minimum_CFL_vpa(speed, vpa)

Calculate the minimum (over a shared-memory block) of the CFL factor 'speed/(grid spacing)' (with no prefactor) corresponding to advection speed speed for advection in the vpa direction.

Reduces the result over the shared-memory block (handling distributed parallelism is left to the calling site). The result is only to be used on rank-0 of the shared-memory block.

source
moment_kinetics.utils.get_minimum_CFL_zMethod
get_minimum_CFL_z(speed, z)

Calculate the minimum (over a shared-memory block) of the CFL factor 'speed/(grid spacing)' (with no prefactor) corresponding to advection speed speed for advection in the z direction.

Reduces the result over the shared-memory block (handling distributed parallelism is left to the calling site). The result is only to be used on rank-0 of the shared-memory block.

source
moment_kinetics.utils.get_unnormalized_parametersFunction
get_unnormalized_parameters(input::Dict)
get_unnormalized_parameters(input_filename::String)

Get many parameters for the simulation setup given by input or in the file input_filename, in SI units and eV, returned as an OrderedDict.

source
moment_kinetics.utils.merge_dict_with_kwargs!Method

Dict merge function for named keyword arguments for case when input Dict is a mixed Dict of Dicts and non-Dict float/int/string entries, and the keyword arguments are also a mix of Dicts and non-Dicts

source