Skip to main content

SolveStats

Struct SolveStats 

Source
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: usize

Number of iterations performed

§final_residual: R

Canonical 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: ConvergedReason

Reason for stopping.

This includes mapped preconditioner lifecycle failures (for example DivergedPcSetupFailed/DivergedPcFailed) when setup/apply errors are propagated through KspContext into SolveStats.

§counters: SolverCounters

Additional 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: usize

Total 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: R

Maximum relative imaginary magnitude observed.

§metrics: SolveMetrics

Optional 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: ReasonDiagnosticsCounters

Stable per-category reason counters for diagnostics automation.

§gmres_classical_retry: bool

True when GMRES internally retried by resetting x and falling back to a classical GMRES pass.

§acceptance_status: AcceptanceStatus

Contract 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: usize

Count of orthogonalization passes executed (including reorthogonalization).

§orthogonalization_rank_loss: bool

Whether an orthogonalization rank-loss failure was observed.

§max_orthogonality_loss_estimate: R

Max 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>

Source

pub fn new( iterations: usize, final_residual: R, reason: ConvergedReason, ) -> Self

Construct a new statistics record with zeroed counters.

Source

pub fn with_counters(self, counters: SolverCounters) -> Self

Attach solver counters to an existing statistics record.

Source

pub fn with_reduction_model(self, model: ReductionModel) -> Self

Source

pub fn with_gcr_counters(self, counters: GcrCounters) -> Self

Attach GCR-specific counters.

Source

pub fn with_fgmres_counters(self, counters: FgmresCounters) -> Self

Attach FGMRES-specific counters.

Source

pub fn with_nested_pc_failure(self, failure: NestedPcFailure) -> Self

Attach nested preconditioner failure metadata.

Source

pub fn with_gmres_classical_retry(self, used: bool) -> Self

Mark whether GMRES performed an internal retry to classical GMRES.

Source

pub fn finalize_reason_counters(self) -> Self

Finalize stable reason diagnostics for this stats record.

Source

pub fn reduction_phase_diagnostics(&self) -> Option<ReductionPhaseDiagnostics>

Per-phase reduction diagnostics inferred from solver counters/model.

Source

pub fn with_orthogonalization_diagnostics( self, passes: usize, rank_loss: bool, max_loss_estimate: R, ) -> Self

Attach orthogonalization diagnostics.

Source

pub fn with_effective_runtime_policy( self, variant: impl Into<String>, restart: usize, residual_check_policy: impl Into<String>, ) -> Self

Attach runtime-effective policy knobs selected by the solver.

Trait Implementations§

Source§

impl<R: Clone> Clone for SolveStats<R>

Source§

fn clone(&self) -> SolveStats<R>

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<R: Debug> Debug for SolveStats<R>

Source§

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

Formats the value using the given formatter. Read more

Auto 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<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<Src, Scheme> ApproxFrom<Src, Scheme> for Src
where Scheme: ApproxScheme,

Source§

type Err = NoError

The error type produced by a failed conversion.
Source§

fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>

Convert the given value into an approximately equivalent representation.
Source§

impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Src
where Dst: ApproxFrom<Src, Scheme>, Scheme: ApproxScheme,

Source§

type Err = <Dst as ApproxFrom<Src, Scheme>>::Err

The error type produced by a failed conversion.
Source§

fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>

Convert the subject into an approximately equivalent representation.
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> ByRef<T> for T

Source§

fn by_ref(&self) -> &T

Source§

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

Source§

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

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

impl<T, Dst> ConvAsUtil<Dst> for T

Source§

fn approx(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst>,

Approximate the subject with the default scheme.
Source§

fn approx_by<Scheme>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst, Scheme>, Scheme: ApproxScheme,

Approximate the subject with a specific scheme.
Source§

impl<T> ConvUtil for T

Source§

fn approx_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst>,

Approximate the subject to a given type with the default scheme.
Source§

fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
where Self: Sized + ApproxInto<Dst, Scheme>, Scheme: ApproxScheme,

Approximate the subject to a given type with a specific scheme.
Source§

fn into_as<Dst>(self) -> Dst
where Self: Sized + Into<Dst>,

Convert the subject to a given type.
Source§

fn try_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + TryInto<Dst>,

Attempt to convert the subject to a given type.
Source§

fn value_as<Dst>(self) -> Result<Dst, Self::Err>
where Self: Sized + ValueInto<Dst>,

Attempt a value conversion of the subject to a given type.
Source§

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

Source§

fn rand<T>(&self, rng: &mut (impl Rng + ?Sized)) -> T
where Self: Distribution<T>,

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
Source§

unsafe 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

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<SS, SP> SupersetOf<SS> for SP
where SS: SubsetOf<SP>,

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

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

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
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<Src> TryFrom<Src> for Src

Source§

type Err = NoError

The error type produced by a failed conversion.
Source§

fn try_from(src: Src) -> Result<Src, <Src as TryFrom<Src>>::Err>

Convert the given value into the subject type.
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<Src, Dst> TryInto<Dst> for Src
where Dst: TryFrom<Src>,

Source§

type Err = <Dst as TryFrom<Src>>::Err

The error type produced by a failed conversion.
Source§

fn try_into(self) -> Result<Dst, <Src as TryInto<Dst>>::Err>

Convert the subject into the destination type.
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<Src> ValueFrom<Src> for Src

Source§

type Err = NoError

The error type produced by a failed conversion.
Source§

fn value_from(src: Src) -> Result<Src, <Src as ValueFrom<Src>>::Err>

Convert the given value into an exactly equivalent representation.
Source§

impl<Src, Dst> ValueInto<Dst> for Src
where Dst: ValueFrom<Src>,

Source§

type Err = <Dst as ValueFrom<Src>>::Err

The error type produced by a failed conversion.
Source§

fn value_into(self) -> Result<Dst, <Src as ValueInto<Dst>>::Err>

Convert the subject into an exactly equivalent representation.
Source§

impl<T, U> Imply<T> for U
where T: ?Sized, U: ?Sized,

Source§

impl<T> ShellContext for T
where T: Send + Sync + Any,