@@ -37,47 +37,18 @@ on the choices.
3737## Preconditioners: ` precs ` Specification
3838
3939Any [ LinearSolve.jl-compatible preconditioner] ( https://docs.sciml.ai/LinearSolve/stable/basics/Preconditioners/ )
40- can be used as a left or right preconditioner. Preconditioners are specified by
41- the ` Pl,Pr = precs(W,du,u,p,t,newW,Plprev,Prprev,solverdata) ` function where
42- the arguments are defined as:
43-
44- - ` W ` : the current Jacobian of the nonlinear system. Specified as either
45- `` I - \gamma J `` or `` I/\gamma - J `` depending on the algorithm. This will
46- commonly be a ` WOperator ` type defined by OrdinaryDiffEq.jl. It is a lazy
47- representation of the operator. Users can construct the W-matrix on demand
48- by calling ` convert(AbstractMatrix,W) ` to receive an ` AbstractMatrix ` matching
49- the ` jac_prototype ` .
50- - ` du ` : the current ODE derivative
51- - ` u ` : the current ODE state
52- - ` p ` : the ODE parameters
53- - ` t ` : the current ODE time
54- - ` newW ` : a ` Bool ` which specifies whether the ` W ` matrix has been updated since
55- the last call to ` precs ` . It is recommended that this is checked to only
56- update the preconditioner when ` newW == true ` .
57- - ` Plprev ` : the previous ` Pl ` .
58- - ` Prprev ` : the previous ` Pr ` .
59- - ` solverdata ` : Optional extra data the solvers can give to the ` precs ` function.
60- Solver-dependent and subject to change.
61-
62- The return is a tuple ` (Pl,Pr) ` of the LinearSolve.jl-compatible preconditioners.
63- To specify one-sided preconditioning, simply return ` nothing ` for the preconditioner
64- which is not used.
65-
66- Additionally, ` precs ` must supply the dispatch:
40+ can be used as a left or right preconditioner. Preconditioners are configured on the ` linsolve `
41+ object itself, through LinearSolve's ` Pl ` / ` Pr ` interface. For example:
6742
6843``` julia
69- Pl, Pr = precs (W, du, u, p, t, :: Nothing , :: Nothing , :: Nothing , solverdata)
44+ using LinearSolve
45+ alg = TRBDF2 (linsolve = KrylovJL_GMRES (precs = mypreconditioner))
7046```
7147
72- which is used in the solver setup phase to construct the integrator
73- type with the preconditioners ` (Pl,Pr) ` .
74-
75- The default is ` precs=DEFAULT_PRECS ` where the default preconditioner function
76- is defined as:
77-
78- ``` julia
79- DEFAULT_PRECS (W, du, u, p, t, newW, Plprev, Prprev, solverdata) = nothing , nothing
80- ```
48+ See the [ LinearSolve preconditioners
49+ documentation] ( https://docs.sciml.ai/LinearSolve/stable/basics/Preconditioners/ )
50+ for the expected ` precs ` function signature (` Pl, Pr = precs(A, p) ` ) and the
51+ full list of supported preconditioner types.
8152
8253## Nonlinear Solvers: ` nlsolve ` Specification
8354
0 commit comments