pub struct Config {Show 24 fields
pub epsilon: f64,
pub max_iter: i32,
pub num_regions: usize,
pub num_zones: usize,
pub nc: DVector<usize>,
pub hr: DVector<f64>,
pub izl: DVector<usize>,
pub q: DVector<f64>,
pub sct: DVector<f64>,
pub scs: DVector<f64>,
pub n: i32,
pub n_half: usize,
pub miu_m: DVector<f64>,
pub omega_m: DVector<f64>,
pub reflex_izq: bool,
pub reflex_der: bool,
pub bound_left: DVector<f64>,
pub bound_right: DVector<f64>,
pub ntc: usize,
pub ntp: usize,
pub sigma_t_vec: DVector<f64>,
pub sigma_s_vec: DVector<f64>,
pub q_ext_vec: DVector<f64>,
pub dx_vec: DVector<f64>,
}Expand description
Configuration for the neutron transport problem.
Contains geometry, material properties, quadrature settings, and boundary conditions for a 1D neutron transport simulation using the discrete ordinates (S_N) method.
§Fields
epsilon- Convergence tolerance for the iterative solvermax_iter- Maximum number of iterations allowednum_regions- Number of spatial regions in the domainnum_zones- Number of material zonesnc- Number of cells per regionhr- Height (thickness) of each region [cm]izl- Material zone ID for each region (1-based)q- External source term per regionsct- Total macroscopic cross section per zonescs- Scattering macroscopic cross section per zonen- Order of the discrete ordinates (S_N)n_half- Half of N (number of directions in one hemisphere)miu_m- Directional cosines (mu values)omega_m- Quadrature weightsreflex_izq- Reflective boundary condition at left boundaryreflex_der- Reflective boundary condition at right boundarybound_left- Incident flux at left boundary (if non-reflective)bound_right- Incident flux at right boundary (if non-reflective)ntc- Total number of cells (sum of nc)ntp- Total number of nodes (ntc + 1)sigma_t_vec- Total cross section per cellsigma_s_vec- Scattering cross section per cellq_ext_vec- External source per celldx_vec- Cell widths
Fields§
§epsilon: f64§max_iter: i32§num_regions: usize§num_zones: usize§nc: DVector<usize>§hr: DVector<f64>§izl: DVector<usize>§q: DVector<f64>§sct: DVector<f64>§scs: DVector<f64>§n: i32§n_half: usize§miu_m: DVector<f64>§omega_m: DVector<f64>§reflex_izq: bool§reflex_der: bool§bound_left: DVector<f64>§bound_right: DVector<f64>§ntc: usize§ntp: usize§sigma_t_vec: DVector<f64>§sigma_s_vec: DVector<f64>§q_ext_vec: DVector<f64>§dx_vec: DVector<f64>Implementations§
Source§impl Config
impl Config
Sourcepub fn new_auto(epsilon: f64, max_iter: i32, input_path: &str) -> Self
pub fn new_auto(epsilon: f64, max_iter: i32, input_path: &str) -> Self
Creates a new configuration by automatically loading from a JSON file.
This method deserializes configuration from a JSON file with the following format:
{
"num_regions": 3,
"num_zones": 3,
"NC": [20, 60, 20],
"HR": [10, 30, 10],
"IZL": [1, 2, 3],
"SCT": [1.0, 0.6, 1],
"SCS": [0.99, 0.4, 0.9],
"Q": [2, 0, 0],
"N": 4,
"reflex_izq": 1,
"reflex_der": 0,
"bound_left": [0, 0],
"bound_right": [0, 0]
}§Arguments
epsilon- Convergence tolerance for the iterative solvermax_iter- Maximum number of iterationsinput_path- Path to the JSON configuration file
§Panics
Panics if the file cannot be opened or deserialized.
§Example
use neutron_diffusion_dd::algorithm::Config;
let config = Config::new_auto(1e-5, 2000, "data/input.json");Sourcepub fn new_manual(epsilon: f64, max_iter: i32) -> Self
pub fn new_manual(epsilon: f64, max_iter: i32) -> Self
Creates a new configuration through interactive manual input.
Prompts the user for all configuration parameters interactively. This is useful for testing and exploration.
§Arguments
epsilon- Convergence tolerance for the iterative solvermax_iter- Maximum number of iterations
§Example
use neutron_diffusion_dd::algorithm::Config;
let config = Config::new_manual(1e-5, 2000);Trait Implementations§
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.