input_structs
moment_kinetics.input_structs
— Modulemoment_kinetics.input_structs.advance_info
— Typemoment_kinetics.input_structs.advection_input
— Typemoment_kinetics.input_structs.boundary_data_type
— Typemoment_kinetics.input_structs.collisions_input
— TypeCollisions input struct to contain all the different collisions substructs and overall collision input parameters.
moment_kinetics.input_structs.electron_physics_type
— Typemoment_kinetics.input_structs.em_fields_input
— TypeSettings for electronmagenetic fields
moment_kinetics.input_structs.geometry_input
— Typemoment_kinetics.input_structs.ion_source_data
— TypeSource 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.
moment_kinetics.input_structs.ion_species_parameters
— Typemoment_kinetics.input_structs.neutral_species_parameters
— Typemoment_kinetics.input_structs.pp_input
— Typemoment_kinetics.input_structs.spatial_initial_condition_input
— Typemoment_kinetics.input_structs.species_composition
— Typemoment_kinetics.input_structs.time_info
— Typet_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.
moment_kinetics.input_structs.velocity_initial_condition_input
— TypeBase.get
— MethodUtility method for converting a string to an Enum when getting from a Dict, based on the type of the default value
moment_kinetics.input_structs.Dict_to_NamedTuple
— MethodConvert an OrderedDict whose keys are String or Symbol to a NamedTuple
Useful as NamedTuple is immutable, so option values cannot be accidentally changed.
moment_kinetics.input_structs.check_sections!
— Methodcheck_sections!(options::OptionsDict)
Check that there are no unexpected sections in options
. The 'expected sections' are the ones that were defined with set_defaults_and_check_section!
.
moment_kinetics.input_structs.convert_to_sorted_nested_OptionsDict
— Methodconvert_to_sorted_nested_OptionsDict(d::AbstractDict)
To ensure consistency when writing options to an output file, the entries in the dictionary containing the options must be in a deterministic order. As TOML reads options into a nested Dict
, the only way to guarantee this is to sort the options before storing them in an OptionsDict
. OptionsDict
is an alias for OrderedDict{String,Any}
so it will preserve the order of entries as long as they were in a consistent order when it was created.
moment_kinetics.input_structs.options_to_TOML
— Methodoptions_to_toml(io::IO [=stdout], data::AbstractDict; sorted=false, by=identity)
Convert moment_kinetics
'options' (in the form of an AbstractDict
) 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
.
moment_kinetics.input_structs.set_defaults_and_check_section!
— Functionset_defaults_and_check_section!(options::OptionsDict, 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 OptionsDict
that can be modified, and then use that OptionsDict
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
.
moment_kinetics.input_structs.set_defaults_and_check_section!
— MethodSet the defaults for options in a section, and check that there are not any unexpected options (i.e. options that have no default).
Modifies the options[section_name]::OptionsDict by adding defaults for any values that are not already present.
moment_kinetics.input_structs.set_defaults_and_check_top_level!
— MethodSet 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]::OptionsDict by adding defaults for any values that are not already present.
Ignores any sections, as these will be checked separately.