spectrax._initialization

Simulation parameter initialization and TOML configuration loading.

Functions

initialize_simulation_parameters([user_parameters, ...])

Assemble the parameter dictionary used to run a Hermite-Fourier Vlasov-Maxwell

load_parameters(input_file)

Load simulation input parameters and solver configuration from a TOML file.

Module Contents

spectrax._initialization.initialize_simulation_parameters(user_parameters={}, Nx=33, Ny=1, Nz=1, Nn=50, Nm=1, Np=1, Ns=2, timesteps=500, dt=0.01)

Assemble the parameter dictionary used to run a Hermite-Fourier Vlasov-Maxwell simulation, starting from library defaults and overriding them with user input. The defaults include a two-stream perturbation, precomputed spectral grids, and helper tables required by the RHS evaluation. Derived quantities are evaluated after merging with any user-provided overrides so that dependent fields remain consistent.

Parameters:
  • user_parameters (Mapping, optional) – Optional dictionary of parameter overrides. Any key present here replaces the corresponding default before derived quantities are computed.

  • Nx (int, optional) – Number of Fourier modes along each spatial direction.

  • Ny (int, optional) – Number of Fourier modes along each spatial direction.

  • Nz (int, optional) – Number of Fourier modes along each spatial direction.

  • Nn (int, optional) – Number of Hermite modes along each velocity-space axis.

  • Nm (int, optional) – Number of Hermite modes along each velocity-space axis.

  • Np (int, optional) – Number of Hermite modes along each velocity-space axis.

  • Ns (int, optional) – Number of particle species represented in the simulation.

  • timesteps (int, optional) – Number of time samples to store in the solution.

  • dt (float, optional) – Initial guess for the integrator time step.

Returns:

Dictionary containing the merged parameters, derived helper arrays, and initial spectral coefficients such as Ck_0 and Fk_0.

Return type:

dict

spectrax._initialization.load_parameters(input_file)

Load simulation input parameters and solver configuration from a TOML file.

Parameters:

input_file (str or pathlib.Path) – Path to the TOML file containing simulation parameters.

Returns:

A pair (input_parameters, solver_parameters) where solver_parameters includes an instantiated Diffrax solver ready for diffeqsolve.

Return type:

tuple[dict, dict]