Configure#
- class pydrad.configure.Configure(config, **kwargs)[source]#
Bases:
object
Configure HYDRAD simulations from a single Python dict
- Parameters:
config (dict) – All input parameters for configuring simulation
Attributes Summary
Beam heating model configuration file.
Collisions header file, HYDRAD/source/collisions.h
Return the current date
Heating model configuration file, Heating_Model/config/heating.cfg.
Heating model header file, Heating_Model/source/config.h
HYDRAD configuration file, HYDRAD/config/hydrad.cfg
HYDRAD header file, HYDRAD/source/config.h
Initial conditions configuration file, Initial_Conditions/config/initial_conditions.cfg
Initial conditions header file, Initial_Conditions/source/config.h
Maximum allowed number of grid cells, \(n_{max}=\lfloor 2^{L_R}n_{min}\rfloor\), where \(L_R\) is the maximum refinement level and \(n_{min}\) is the minimum allowed number of grid cells.
Minimum allowed number of grid cells, \(n_{min}=\lceil L/\Delta s_{max}\rceil\), where \(L\) is the loop length and \(\Delta s_{max}\) is the maximum allowed grid cell width.
Sixth-order polynomial fit coefficients for computing gravitational acceleration
Sixth-order polynomial fit coefficients for computing flux tube expansion
Equilibrium elements configuration file, Radiation_Model/config/elements_eq.cfg
Radiation model header file, Radiation_Model/source/config.h
Non-equilibrium elements configuration file, Radiation_Model/config/elements_neq.cfg
List of available templates
Methods Summary
get_raw_template
(name)Return the unrendered template.
load_config
(filename)Load a base configuration from an ASDF file
save_config
(filename)Save the simulation configuration as an ASDF file
setup_hydrad
(root_dir)Compile HYDRAD code with appropriate header and config files
setup_initial_conditions
(root_dir[, execute])Compile and run the initial conditions code to get the initial loop profile
setup_simulation
(output_path, base_path[, ...])Setup a HYDRAD simulation with desired outputs from a clean copy
Attributes Documentation
- beam_heating_cfg#
Beam heating model configuration file.
- collisions_header#
Collisions header file, HYDRAD/source/collisions.h
- date#
Return the current date
- heating_cfg#
Heating model configuration file, Heating_Model/config/heating.cfg. If background heating is enabled and you want to use the equilibrium values, you must run the initial conditions and set the equilibrium_heating_rate attribute first.
- heating_header#
Heating model header file, Heating_Model/source/config.h
- hydrad_build_script#
- hydrad_cfg#
HYDRAD configuration file, HYDRAD/config/hydrad.cfg
- hydrad_header#
HYDRAD header file, HYDRAD/source/config.h
- initial_conditions_build_script#
- initial_conditions_cfg#
Initial conditions configuration file, Initial_Conditions/config/initial_conditions.cfg
- initial_conditions_header#
Initial conditions header file, Initial_Conditions/source/config.h
- maximum_cells#
Maximum allowed number of grid cells, \(n_{max}=\lfloor 2^{L_R}n_{min}\rfloor\), where \(L_R\) is the maximum refinement level and \(n_{min}\) is the minimum allowed number of grid cells. Optionally, if the maximum number of cells is specified in
config['grid']['maximum_cells']
, this value will take precedence.
- minimum_cells#
Minimum allowed number of grid cells, \(n_{min}=\lceil L/\Delta s_{max}\rceil\), where \(L\) is the loop length and \(\Delta s_{max}\) is the maximum allowed grid cell width. Optionally, if the minimum number of cells is specified in
config['grid']['minimum_cells']
, this value will take precedence.
- optimization_flags#
- poly_fit_gravity#
Sixth-order polynomial fit coefficients for computing gravitational acceleration
- poly_fit_magnetic_field#
Sixth-order polynomial fit coefficients for computing flux tube expansion
- radiation_equilibrium_cfg#
Equilibrium elements configuration file, Radiation_Model/config/elements_eq.cfg
- radiation_header#
Radiation model header file, Radiation_Model/source/config.h
- radiation_nonequilibrium_cfg#
Non-equilibrium elements configuration file, Radiation_Model/config/elements_neq.cfg
- templates#
List of available templates
Methods Documentation
- static load_config(filename)[source]#
Load a base configuration from an ASDF file
- Parameters:
filename (str) –
- save_config(filename)[source]#
Save the simulation configuration as an ASDF file
- Parameters:
filename (str) –
- setup_hydrad(root_dir)[source]#
Compile HYDRAD code with appropriate header and config files
- Parameters:
root_dir (str) – Path to new HYDRAD copy
- setup_initial_conditions(root_dir, execute=True)[source]#
Compile and run the initial conditions code to get the initial loop profile
- Parameters:
root_dir (path-like) – Path to new HYDRAD copy
execute (bool) – If True (default), compute initial conditions. Otherwise, they are only compiled. This is useful for debugging.
- setup_simulation(output_path, base_path, run_initial_conditions=True, overwrite=False, **kwargs)[source]#
Setup a HYDRAD simulation with desired outputs from a clean copy
- Parameters:
output_path (str) – Path to new copy of HYDRAD
base_path (str) – Path to existing HYDRAD
run_initial_conditions (bool) – If True, compile and run the initial conditions code
overwrite (bool) – If True, overwrite an existing HYDRAD instance at
output_path
if it exists.