pub struct SolverDiagnostics {
pub iterations: usize,
pub final_residual: f64,
pub converged: bool,
pub history: Vec<f64>,
}Expand description
Tracks solver convergence history and diagnostics.
Fields§
§iterations: usizeNumber of iterations performed.
final_residual: f64Final residual after last iteration.
converged: boolWhether the solver converged.
history: Vec<f64>Per-iteration residual history.
Implementations§
Source§impl SolverDiagnostics
impl SolverDiagnostics
Sourcepub fn check_convergence(&self, tolerance: f64) -> PhysicsResult<()>
pub fn check_convergence(&self, tolerance: f64) -> PhysicsResult<()>
Marks convergence and returns Ok(()), or Err(ConvergenceFailed).
Sourcepub fn convergence_rate(&self) -> Option<f64>
pub fn convergence_rate(&self) -> Option<f64>
Returns the geometric-mean convergence rate from the last 5 residuals,
or None if fewer than 2 residuals have been recorded.
Sourcepub fn is_diverging(&self) -> bool
pub fn is_diverging(&self) -> bool
Check if the solver is diverging (residual increasing over the last few iterations).
Trait Implementations§
Source§impl Clone for SolverDiagnostics
impl Clone for SolverDiagnostics
Source§fn clone(&self) -> SolverDiagnostics
fn clone(&self) -> SolverDiagnostics
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SolverDiagnostics
impl Debug for SolverDiagnostics
Auto Trait Implementations§
impl Freeze for SolverDiagnostics
impl RefUnwindSafe for SolverDiagnostics
impl Send for SolverDiagnostics
impl Sync for SolverDiagnostics
impl Unpin for SolverDiagnostics
impl UnsafeUnpin for SolverDiagnostics
impl UnwindSafe for SolverDiagnostics
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.