Other Components¶
Simulation Manager¶
-
vlapy.manager.start_run(all_params, pulse_dictionary, diagnostics, uris, name='test')¶ This is the highest level function that calls the time integration loop
MLFlow is initialized here. Domain configuration is also performed here. All file storage is initialized here.
- Parameters
all_params – (dictionary) contains the input parameters of the simulation
pulse_dictionary – (dictionary) contains the parameters for the ponderomotive force driver
diagnostics – (vlapy.Diagnostics) contains the diagnostics routine for this particular simulation
uris – (string) the location of the mlflow server
name – (string) the name of the MLFlow experiment
- Returns
(Mlflow.Run) returns the completed Run object
Storage Module¶
-
vlapy.storage.combine_and_save_dataset(individual_path, overall_path)¶ This function 1 - loads multiple dataarrays 2 - concatenates them into one dataset 3 - writes to file
- Parameters
individual_path – (string) path to the folder containing the data from each batch
overall_path – (string) path to the folder containing the combined data
-
vlapy.storage.combine_save_and_open_dataset(individual_path, overall_path)¶ This function combines the datasets created per batch along the time axis. Then it saves the newly combined dataset and deletes the reference to free up memory.
Then it lazy loads the newly combined dataset
- Parameters
individual_path – (string) path to the folder containing the data from each batch
overall_path – (string) path to the folder containing the combined data
- Returns
(xArray Dataset) lazy loaded xarray dataset
-
vlapy.storage.get_batched_data_from_sim_config(sim_config)¶ This function is a simple helper for grabbing all the data stored in the simulation history
- Parameters
sim_config –
- Returns
-
vlapy.storage.get_paths(base_path)¶ This function writes the paths to a dictionary and also makes the folder structure
- Parameters
base_path –
- Returns
Outer Loop Module¶
-
vlapy.outer_loop.get_arrays_for_inner_loop(stuff_for_time_loop, nt_in_loop, store_f_rules, this_np)¶ This function converts and consolidates the derived parameters for the simulation into a dictionary that contains everything necessary for the inner loop
- Parameters
stuff_for_time_loop – (dictionary) derived parameters for the simulation
nt_in_loop – (int) number of steps in the inner loop
store_f_rules – (dictionary) containing the rules for storing f in the inner loop
- Returns
(dictionary) the dictionary with all the information and storage required by the inner loop
-
vlapy.outer_loop.get_everything_ready_for_outer_loop(diagnostics, all_params, pulse_dictionary, overall_num_steps)¶ In order to keep the main time loop clean, this function handles all the necessary initialization and array creation for the main simulation time loop.
Initialized here: spatial grid velocity grid distribution function time grid driver array
- Parameters
diagnostics – (vlapy.Diagnostics) Object describing the diagnostics and analysis used for this simulation
all_params – (dictionary) contains the input parameters for the simulation
pulse_dictionary – (dictionary) contains the parameters describing the ponderomotive force driver for
the simulation :return: (dictionary) contains the derived parameters for the simulation
-
vlapy.outer_loop.get_inner_loop_stepper(all_params, stuff_for_time_loop, steps_in_loop)¶ This is where the NumPy-based inner-loop is created and returned
- Parameters
all_params –
stuff_for_time_loop –
steps_in_loop –
rules_to_store_f –
- Returns
-
vlapy.outer_loop.get_sim_config_and_inner_loop_step(all_params, stuff_for_time_loop, nt_in_loop, store_f_rules)¶ This is the function that gets the correct inner loop calculation routines given the backend, and the dictionary used for storing quantities in the inner loop.
- Parameters
all_params – (dictionary)
stuff_for_time_loop – (dictionary) derived parameters for the simulation
nt_in_loop – (int) number of steps in the inner loop
store_f_rules – (dictionary) containing the rules for storing f in the inner loop
- Returns
(dictionary, function) the dictionary with all the information and storage required by the inner loop
and the function for all the steps in the inner loop / a single step of the outer loop
-
vlapy.outer_loop.post_inner_loop_update(temp_storage, this_np)¶ This function updates the storage at the end of a step of the outer-loop, i.e., after all steps in the inner loop.
- Parameters
temp_storage – (dictionary) the dictionary with all the information and storage required by the inner loop
this_np – (NumPy) the numpy that is used to calculate the cumulative sum
- Returns
Initializers Module¶
-
vlapy.initializers.initialize_distribution(nx, nv, vmax=6.0)¶ Initializes a Maxwell-Boltzmann distribution
TODO: temperature and density pertubations
- Parameters
nx – (int) size of grid in x
nv – (int) size of grid in v
vmax – (float) maximum absolute value of v
- Returns
(float array (nx, nv)) distribution function initialized as a Maxwell-Boltzmann
-
vlapy.initializers.initialize_spatial_quantities(xmin, xmax, nx)¶ This function initializes the spatial grid and related quantities
- Parameters
xmin – (float) the minimum value of x represented by the simulation
xmax – (float) the maximum value of x represented by the simulation
nx – (int) the size of the x-grid
- Returns
(float, float array (nx, ), float array (nx, )) the grid spacing, the spatial grid,
and the corresponding spatial wave-number grid
-
vlapy.initializers.initialize_velocity_quantities(vmax, nv)¶ This function initializes the velocity grid and related quantities
- Parameters
vmax – (float) the absolute value of the maximum velocity
nv – (int) the size of the grid in v
- Returns
(float, float array (nv, ), float array (nv, )) the grid spacing, the velocity grid,
and the corresponding velocity wave-number grid
-
vlapy.initializers.log_initial_conditions(all_params, pulse_dictionary)¶ This function logs initial conditions to the mlflow server.
- Parameters
all_params – (dictionary) contains the provided input parameters to the simulation
pulse_dictionary – (dictionary) contains the derived input parameters to the simulation
-
vlapy.initializers.make_default_params_dictionary()¶ Return a dictionary of default parameters
- Returns
(dictionary) Contains the default parameters for VlaPy
-
vlapy.initializers.specify_collisions_to_dict(log_nu_over_nu_ld, all_params_dict)¶ This function adds the collision frequency to the parameters dictionary
- Parameters
log_nu_over_nu_ld – (float) log( nu_ee / nu_ld )
all_params_dict – (dictionary) contains the input parameters for the simulation
- Returns
(dictionary) parameters updated with the desired collision frequency
-
vlapy.initializers.specify_epw_params_to_dict(k0, all_params_dict)¶ This function calculates the roots to the dispersion relation for EPWs for a particular k0. This stores the w_epw and nu_ld for that EPW in the all_params_dict as well as dictates the size of the box through xmax.
- Parameters
k0 – (float) the desired EPW wavenumber
all_params_dict – (dictionary) contains the input parameters for the simulation
- Returns
(dictionary) parameters updated with the solution to the dispersion relation
for the desired wavenumber. This is typically used by the ponderomotive force driver.