pub struct SolveStats<R> {Show 26 fields
pub iterations: usize,
pub final_residual: R,
pub final_recurrence_residual: Option<R>,
pub final_true_residual: Option<R>,
pub last_preconditioned_residual: Option<R>,
pub reason: ConvergedReason,
pub counters: SolverCounters,
pub gcr_counters: Option<GcrCounters>,
pub fgmres_counters: Option<FgmresCounters>,
pub reduction_model: Option<ReductionModel>,
pub complex_drift_events: usize,
pub complex_drift_counts: [usize; 6],
pub complex_drift_max_rel: R,
pub metrics: SolveMetrics,
pub nested_pc_failure: Option<NestedPcFailure>,
pub reason_counters: ReasonDiagnosticsCounters,
pub gmres_classical_retry: bool,
pub acceptance_status: AcceptanceStatus,
pub breakdown_reason: Option<ConvergedReason>,
pub residual_override_note: Option<String>,
pub orthogonalization_passes: usize,
pub orthogonalization_rank_loss: bool,
pub max_orthogonality_loss_estimate: R,
pub effective_variant: Option<String>,
pub effective_restart: Option<usize>,
pub effective_residual_check_policy: Option<String>,
}Expand description
Statistics from a solve operation.
Fields§
§iterations: usizeNumber of iterations performed
final_residual: RCanonical final residual norm for reporting.
Solvers should prefer storing the explicit true residual norm when it is computed; otherwise this may be a recurrence/estimated residual.
final_recurrence_residual: Option<R>Optional final residual from the Krylov recurrence/estimator.
final_true_residual: Option<R>Optional final explicit true residual ||b - A x||_2.
last_preconditioned_residual: Option<R>Optional latest preconditioned residual norm.
reason: ConvergedReasonReason for stopping.
This includes mapped preconditioner lifecycle failures (for example
DivergedPcSetupFailed/DivergedPcFailed) when setup/apply errors are
propagated through KspContext into SolveStats.
counters: SolverCountersAdditional counters collected during the solve.
gcr_counters: Option<GcrCounters>Optional GCR-specific counters.
fgmres_counters: Option<FgmresCounters>Optional FGMRES-specific counters.
reduction_model: Option<ReductionModel>Reduction accounting model for the selected solver variant.
complex_drift_events: usizeTotal number of complex drift events observed during reductions.
complex_drift_counts: [usize; 6]Per-kind complex drift counts captured by the solver.
complex_drift_max_rel: RMaximum relative imaginary magnitude observed.
metrics: SolveMetricsOptional solver timing and reduction metrics.
nested_pc_failure: Option<NestedPcFailure>Structured details for nested preconditioner failures, when available.
Outer solves use this to preserve the inner component/reason/iteration context when KSP-as-PC or other nested preconditioners fail.
reason_counters: ReasonDiagnosticsCountersStable per-category reason counters for diagnostics automation.
gmres_classical_retry: boolTrue when GMRES internally retried by resetting x and falling back to
a classical GMRES pass.
acceptance_status: AcceptanceStatusContract acceptance status from true residual + stop reason classification.
breakdown_reason: Option<ConvergedReason>Breakdown/divergence reason captured before any residual-based override.
residual_override_note: Option<String>Optional note describing residual-based acceptance override decisions.
orthogonalization_passes: usizeCount of orthogonalization passes executed (including reorthogonalization).
orthogonalization_rank_loss: boolWhether an orthogonalization rank-loss failure was observed.
max_orthogonality_loss_estimate: RMax estimate of orthogonality loss observed during the solve.
effective_variant: Option<String>Effective solver variant selected at runtime (if policy hooks mutated it).
effective_restart: Option<usize>Effective restart value selected at runtime.
effective_residual_check_policy: Option<String>Effective residual-check policy selected at runtime.
Implementations§
Source§impl<R: Default> SolveStats<R>
impl<R: Default> SolveStats<R>
Sourcepub fn new(
iterations: usize,
final_residual: R,
reason: ConvergedReason,
) -> Self
pub fn new( iterations: usize, final_residual: R, reason: ConvergedReason, ) -> Self
Construct a new statistics record with zeroed counters.
Sourcepub fn with_counters(self, counters: SolverCounters) -> Self
pub fn with_counters(self, counters: SolverCounters) -> Self
Attach solver counters to an existing statistics record.
pub fn with_reduction_model(self, model: ReductionModel) -> Self
Sourcepub fn with_gcr_counters(self, counters: GcrCounters) -> Self
pub fn with_gcr_counters(self, counters: GcrCounters) -> Self
Attach GCR-specific counters.
Sourcepub fn with_fgmres_counters(self, counters: FgmresCounters) -> Self
pub fn with_fgmres_counters(self, counters: FgmresCounters) -> Self
Attach FGMRES-specific counters.
Sourcepub fn with_nested_pc_failure(self, failure: NestedPcFailure) -> Self
pub fn with_nested_pc_failure(self, failure: NestedPcFailure) -> Self
Attach nested preconditioner failure metadata.
Sourcepub fn with_gmres_classical_retry(self, used: bool) -> Self
pub fn with_gmres_classical_retry(self, used: bool) -> Self
Mark whether GMRES performed an internal retry to classical GMRES.
Sourcepub fn finalize_reason_counters(self) -> Self
pub fn finalize_reason_counters(self) -> Self
Finalize stable reason diagnostics for this stats record.
Sourcepub fn reduction_phase_diagnostics(&self) -> Option<ReductionPhaseDiagnostics>
pub fn reduction_phase_diagnostics(&self) -> Option<ReductionPhaseDiagnostics>
Per-phase reduction diagnostics inferred from solver counters/model.
Sourcepub fn with_orthogonalization_diagnostics(
self,
passes: usize,
rank_loss: bool,
max_loss_estimate: R,
) -> Self
pub fn with_orthogonalization_diagnostics( self, passes: usize, rank_loss: bool, max_loss_estimate: R, ) -> Self
Attach orthogonalization diagnostics.
Trait Implementations§
Source§impl<R: Clone> Clone for SolveStats<R>
impl<R: Clone> Clone for SolveStats<R>
Source§fn clone(&self) -> SolveStats<R>
fn clone(&self) -> SolveStats<R>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<R> Freeze for SolveStats<R>where
R: Freeze,
impl<R> RefUnwindSafe for SolveStats<R>where
R: RefUnwindSafe,
impl<R> Send for SolveStats<R>where
R: Send,
impl<R> Sync for SolveStats<R>where
R: Sync,
impl<R> Unpin for SolveStats<R>where
R: Unpin,
impl<R> UnsafeUnpin for SolveStats<R>where
R: UnsafeUnpin,
impl<R> UnwindSafe for SolveStats<R>where
R: UnwindSafe,
Blanket Implementations§
Source§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
Source§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Source§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
Source§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
Source§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
Source§impl<T> ConvUtil for T
impl<T> ConvUtil for T
Source§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Source§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
Source§impl<T> DistributionExt for Twhere
T: ?Sized,
impl<T> DistributionExt for Twhere
T: ?Sized,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
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>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§unsafe fn to_subset_unchecked(&self) -> SS
unsafe fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.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>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
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
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.