input_structs

moment_kinetics.input_structs.ion_source_dataType

Source profile structs for ions and electrons which allows them to have any number of different sources (from wall perhaps, superposition of core sources, etc.). These sources are then contained in a vector of structs.

Since the ion source must be the same as the electron source in all respects (apart from possibly a different electron temperature or source strength), the electron vector of source profile structs will be a kind of mirror of the ion vector of structs.

source
moment_kinetics.input_structs.time_infoType

t_error_sum is included so that a type which might be mkfloat or Float128 can be set by an option but known at compile time when a `timeinfo` struct is passed as a function argument.

source
Base.getMethod

Utility method for converting a string to an Enum when getting from a Dict, based on the type of the default value

source
moment_kinetics.input_structs.options_to_TOMLMethod
options_to_toml(io::IO [=stdout], data::AbstractDict; sorted=false, by=identity)

Convert moment_kinetics 'options' (in the form of a Dict) to TOML format.

This function is defined so that we can handle some extra types, for example Enum.

For descriptions of the arguments, see TOML.print.

source
moment_kinetics.input_structs.set_defaults_and_check_section!Function
set_defaults_and_check_section!(options::AbstractDict, struct_type::Type,
                                name::Union{String,Nothing}=nothing)

Alternative form to be used when the options should be stored in a struct of type struct_type rather than a NamedTuple. struct_type must be defined using @kwdef.

The returned instance of struct_type is immutable, so if you need to modify the settings

  • e.g. to apply some logic to set defaults depending on other settings/parameters - then

you should use the 'standard' version of set_defaults_and_check_section! that returns a Dict that can be modified, and then use that Dict to initialise the struct_type.

The name of the section in the options that will be read defaults to the name of struct_type, but can be set using the section_name argument.

Returns an instance of struct_type.

source
moment_kinetics.input_structs.set_defaults_and_check_top_level!Method

Set the defaults for options in the top level of the input, and check that there are not any unexpected options (i.e. options that have no default).

Modifies the options[section_name]::Dict by adding defaults for any values that are not already present.

Ignores any sections, as these will be checked separately.

source