Struct GridConfig

Source
pub struct GridConfig {
    pub x_min: f64,
    pub x_max: f64,
    pub n_points: usize,
    pub x_transition: f64,
    pub log_fraction: f64,
    pub refinement_zones: Vec<RefinementZone>,
}
Expand description

Configuration for the frequency grid.

Presets Self::fast (500 points) and Self::production (4000 points) cover the common cases. Hand-rolled configurations must satisfy Self::validate: in particular, x_max ≥ 30 for accurate G₃ integrals.

Fields§

§x_min: f64

Lower grid bound in dimensionless frequency x = hν/(kT_z). Must be positive (log spacing). Default 1e-4.

§x_max: f64

Upper grid bound. Must be ≥ 30 for accurate spectral integrals.

§n_points: usize

Total number of grid points.

§x_transition: f64

Transition frequency from log to linear spacing.

§log_fraction: f64

Fraction of points allocated to the log region (must be in [0, 1)).

§refinement_zones: Vec<RefinementZone>

Optional refinement zones for extra resolution near injection features.

Implementations§

Source§

impl GridConfig

Source

pub fn production() -> Self

Production-quality grid: 4000 points, x ∈ [1e-5, 60]. Used for all paper runs.

Source

pub fn fast() -> Self

Fast/testing grid: 500 points, x ∈ [1e-4, 40]. Suitable for quick exploratory runs; distortion amplitudes are accurate to a few percent.

Source

pub fn validate(&self) -> Result<(), String>

Validate grid configuration parameters.

Returns Err with a descriptive message if any parameter would cause numerical failure or produce meaningless results.

Source

pub fn with_refinement(self, zone: RefinementZone) -> Self

Add a refinement zone to this grid configuration.

Trait Implementations§

Source§

impl Clone for GridConfig

Source§

fn clone(&self) -> GridConfig

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for GridConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for GridConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.