Run settings
src/settings.jl
Public
Runes2P.OUTPUT_FORMAT_VERSION — Constant
OUTPUT_FORMAT_VERSIONVersion of the output file format, written as the string "major.minor.patch" in the root attribute format_version. It counts up with every change of the file's content. Since 0.0.5 a file stores units (write_output):
- Every entry of the group
unknownscarries the unit of its unknown in the attributeunit, and the entry of each unknown in the grouplayoutholds it asunit. - The dataset
timecarries the attributeunit, which is"s". - The datasets of the grid faces in the group
layoutcarry the attributeunit.
Runes2P.DescriptionContext — Type
DescriptionContext(; times=Float64[], max_table_bytes=67108864)Context shared by the describe calls of one run. Kinetic grids are described once and referred to by name (grid_1, grid_2, … in the order of first use; grids with equal faces share a name). times are the run's time points, at which prescribed functions of time are sampled. The tables of the samples are kept in the context and referred to by name (table_1, …), each at most max_table_bytes large. A function used by several terms or updates has one table.
Runes2P.code_version — Method
code_version()Record of the code a run uses: the Runes2P package version, the commit of the Runes2P checkout with its branch, whether the tracked files of the checkout were unchanged (tree_clean), and the Julia version. The checkout is read once per session, at the first call. Outside a checkout (an installed package) the commit is "unknown" and commit_known is false.
Runes2P.describe — Function
describe(op::FieldParticleOperator, context=DescriptionContext())Record of the field-particle operator: the grid, the number of modes, the scheme of its electron-electron operator, the pitch rule of the momentum weights, and the plasma and the collision settings it was built from. The functionals and the shapes follow from them.
Runes2P.describe — Function
describe(model::ConductivityModel, context)Record of a conductivity model: the reference, what is subtracted for the kinetic operator, and the conductivity per radius at the time points of context (at the first one for a plasma that is constant in time).
Runes2P.describe — Function
describe(op::KnockOnOperator, context=DescriptionContext())Record of the operator: the knock-on and primary grids, the evaluation method, the cutoff momentum per radius as it is now, and the options of the kernels with their defaults filled in (resolved_pitch_options).
Runes2P.describe — Function
describe(system::EquationSystem, context=DescriptionContext())Record of the system: per unknown the kind of its equation and its terms (term_1, term_2, … in the order given), the time scale, and the Newton and time-step tolerances of every unknown as they apply (the defaults filled in). The layout has its own record.
Runes2P.describe — Function
describe(region::MomentumRegion, context)Record of a momentum region: the side, the envelope and the limit. A limit that follows the temperature is recorded with its factor and the temperatures at the time points of context, another function of time with its values at the time points.
Runes2P.describe — Function
describe(op::AdvectionDiffusion, context=DescriptionContext(); coefficients=true)Record of the operator: its grid, schemes and boundary conditions, its declarations of radial transport and cross diffusion, the boundary flux at p_min when it is not zero, and with coefficients = true the coefficient arrays. An array that is zero everywhere is named in zero_coefficients and not stored. When the coefficients were built by set_fokker_planck_coefficients!, the plasma and the collision settings they were built from are recorded under coefficient_source. The arrays are the definition of the operator, the source is what explains them. Arrays changed by hand afterwards leave the source as it was.
Runes2P.describe — Method
Records of the grids registered in the context, by name.
Runes2P.describe — Method
describe(object)
describe(object, context::DescriptionContext)Plain record of object: a dictionary with string keys holding its type under "type" and its settings as strings, numbers, arrays of numbers, lists of strings and nested records. Defined for the grids, the layout, the plasma and collision settings, the operators, the terms, the equation system and the solvers. With a context, kinetic grids are referred to by name and prescribed functions of time are sampled at the run's time points. An object without a method gets a record with "described" => false.
A term defined outside the package adds Runes2P.describe(term::MyTerm, context::Runes2P.DescriptionContext).
Runes2P.describe — Method
describe(layout)
describe(layout, context::DescriptionContext)Plain record of the layout: the order of the unknowns and per unknown its kind, scale, position, sizes per radius, components, grid and lower limit. With a context the grids are named in it (the layout section of the settings, next to their grids section). Without one, the record holds the records of its grids under grids and the unit of each unknown, and is self-contained: it is the root group layout of the output and checkpoint files, which a resume reads to match the unknowns by name (copy_unknowns!) and to rebuild the grids (layout_version 2). The units stay out of the settings, so that the setup hash does not depend on them.
Runes2P.describe_prescribed_plasma — Method
describe_prescribed_plasma(plasma_at, context)Table of a plasma state prescribed as a function of time, plasma_at(t): the states at the time points of context, stacked along a last time axis ((radii, times) for the profiles, (charge states, radii, times) for the ion densities). These are the states the steps of the run use, except the steps shortened after a failure. A function cannot be stored, so the table is the record of it. A table that would exceed the context's max_table_bytes is thinned: sampled evenly over the time points at as many as fit, and marked thinned. Without time points, or when the function fails at one, the record is marked as not described. The reason of a failure keeps the type of the exception, without its module, and the first line of its message, followed by the next line when it ends in a colon, with absolute file paths of two or more parts replaced by <path>.
Runes2P.run_environment — Method
run_environment()Record of where a run runs: host, CPU model, thread counts of the machine, Julia and BLAS, the BLAS libraries, the start time, and the Slurm job when there is one. It is not part of the setup hash. The CPU model is read once per session.
Runes2P.settings_fields — Method
settings_fields(T)(described, derived): the fields of the type T that its describe record holds, and those it leaves out because they follow from the described ones (work arrays, caches, Jacobians of a grid). Every field is in one of the two, which the tests check, so a field added to a type must be classified. Types without a method describe every field.
Runes2P.settings_hash — Method
settings_hash(record)SHA-256 of a plain record, as 64 hexadecimal digits. The hash does not depend on the order of the keys. It covers the type of every value (an integer 1 and a floating-point 1.0 differ) and the bits of floating-point numbers, so records read back from a file hash as the records written.
Internal
Runes2P.SettingsRecord — Type
A plain record: string keys, plain values (see the head of src/settings.jl).
Runes2P.describe_prescribed_levels — Method
describe_prescribed_levels(levels_at, context; points=nothing)Record of a level prescribed as a function of time (a number or one value per radial face): the record of a PiecewiseConstant, or the values at the time points of context, thinned as the tables of the prescribed plasma are. With points, the function may return a callable of r (radial_values): the values are those at points, and profile records the callable (an interpolator by its points), or profiles one per sampled time where it changes in time. When the function fails at a time point, the record is marked as not described, and its reason keeps the type of the exception, without its module, and the first line of its message, followed by the next line when it ends in a colon, with absolute file paths of two or more parts replaced by <path>.
Runes2P.describe_tables — Method
Records of the tables registered in the context, by name.
Runes2P.grid_name! — Method
Name of grid in the context, registering it at its first use.
Runes2P.output_format_version — Method
The format version as written to files, "major.minor.patch".
Runes2P.prescribed_table! — Method
Name of the table of the prescribed plasma plasma_at in the context, which builds it at the first use.