diffsol_nl/lib.rs
1//! # diffsol-nl
2//!
3//! Time-unaware non-linear solver traits and implementations for
4//! [diffsol](https://github.com/martinjrobins/diffsol).
5//!
6//! This crate provides the non-linear operator and solver abstractions used by
7//! diffsol, together with a Newton implementation built on top of the linear
8//! solvers provided by [`diffsol_la`].
9
10/// Convergence testing for iterative non-linear solvers.
11///
12/// This module defines the [Convergence] struct and [ConvergenceStatus] enum used
13/// to test for convergence (and divergence) of the Newton iteration.
14pub mod convergence;
15
16/// Error types and handling.
17///
18/// This module defines the [NlError] enum for the non-linear solver layer, which
19/// wraps solver-specific errors ([NonLinearSolverError]) as well as linear-algebra
20/// errors from [`diffsol_la`].
21pub mod error;
22
23/// Line search implementations for globalising the Newton iteration.
24///
25/// This module defines the [LineSearch] trait and provides the [NoLineSearch] and
26/// [BacktrackingLineSearch] implementations.
27pub mod line_search;
28
29/// The Newton non-linear solver.
30///
31/// This module provides [NewtonNonlinearSolver], an implementation of the
32/// [NonLinearSolver] trait using Newton's method, as well as the standalone
33/// [newton_iteration] function.
34pub mod newton;
35
36/// The [NonLinearOp] and [NonLinearOpJacobian] traits describing a time-unaware
37/// non-linear operator `F(x)` and its Jacobian `J(x)`.
38pub mod nonlinear_op;
39
40/// Non-linear solver traits.
41///
42/// This module defines the [NonLinearSolver] trait for solving `F(x) = 0`.
43pub mod nonlinear_solver;
44
45pub use convergence::{Convergence, ConvergenceStatus};
46pub use error::{NlError, NonLinearSolverError};
47pub use line_search::{BacktrackingLineSearch, LineSearch, NoLineSearch};
48pub use newton::{newton_iteration, NewtonNonlinearSolver};
49pub use nonlinear_op::{NonLinearOp, NonLinearOpJacobian};
50pub use nonlinear_solver::{NonLinearSolveSolution, NonLinearSolver};