pub struct SolverBuilder { /* private fields */ }Expand description
Fluent builder for ThermalizationSolver.
Groups all configuration into a chainable API. The existing
ThermalizationSolver::new() + manual field mutation still works;
this is a convenience layer on top.
Implementations§
Source§impl SolverBuilder
impl SolverBuilder
Sourcepub fn grid(self, config: GridConfig) -> Self
pub fn grid(self, config: GridConfig) -> Self
Set the frequency grid configuration.
Sourcepub fn grid_production(self) -> Self
pub fn grid_production(self) -> Self
Use the production (4000-point) grid for high-accuracy runs.
Sourcepub fn injection(self, scenario: InjectionScenario) -> Self
pub fn injection(self, scenario: InjectionScenario) -> Self
Set the energy injection scenario.
Sourcepub fn initial_delta_n(self, delta_n: Vec<f64>) -> Self
pub fn initial_delta_n(self, delta_n: Vec<f64>) -> Self
Set an initial photon perturbation Δn(x).
Sourcepub fn z_range(self, z_start: f64, z_end: f64) -> Self
pub fn z_range(self, z_start: f64, z_end: f64) -> Self
Set the redshift range (z_start, z_end).
Sourcepub fn solver_config(self, config: SolverConfig) -> Self
pub fn solver_config(self, config: SolverConfig) -> Self
Set a complete solver config, overriding individual z/dy/dtau settings.
Sourcepub fn disable_dcbr(self) -> Self
pub fn disable_dcbr(self) -> Self
Disable DC/BR processes (Kompaneets only).
Sourcepub fn split_dcbr(self) -> Self
pub fn split_dcbr(self) -> Self
Use operator-split DC/BR instead of coupled IMEX.
Sourcepub fn number_conserving(self) -> Self
pub fn number_conserving(self) -> Self
Enable number-conserving T-shift subtraction (on by default).
Sourcepub fn no_number_conserving(self) -> Self
pub fn no_number_conserving(self) -> Self
Disable number-conserving T-shift subtraction.
Sourcepub fn nc_z_min(self, val: f64) -> Self
pub fn nc_z_min(self, val: f64) -> Self
Set the minimum redshift for number-conserving subtraction.
Sourcepub fn dcbr_scale(self, val: f64) -> Self
pub fn dcbr_scale(self, val: f64) -> Self
Scale DC/BR emission rates by this factor (diagnostic).
Sourcepub fn max_newton_iter(self, val: usize) -> Self
pub fn max_newton_iter(self, val: usize) -> Self
Set the maximum number of Newton iterations per Kompaneets step.
Sourcepub fn no_auto_refine(self) -> Self
pub fn no_auto_refine(self) -> Self
Disable automatic refinement zone insertion for photon injection scenarios.
Sourcepub fn build(self) -> Result<ThermalizationSolver, String>
pub fn build(self) -> Result<ThermalizationSolver, String>
Build the configured solver.
Validates all configuration (cosmology, grid, solver config, injection)
before constructing the solver. Returns Err with a descriptive message
if any parameter is invalid.