1
1
module OrdinaryDiffEqRosenbrock
2
2
3
3
import OrdinaryDiffEqCore: alg_order, alg_adaptive_order, isWmethod, isfsal, _unwrap_val,
4
- DEFAULT_PRECS, OrdinaryDiffEqRosenbrockAlgorithm, @cache ,
4
+ OrdinaryDiffEqRosenbrockAlgorithm, @cache ,
5
5
alg_cache, initialize!, @unpack ,
6
6
calculate_residuals!, OrdinaryDiffEqMutableCache,
7
7
OrdinaryDiffEqConstantCache, _ode_interpolant, _ode_interpolant!,
@@ -54,7 +54,6 @@ function rosenbrock_wanner_docstring(description::String,
54
54
concrete_jac = nothing,
55
55
diff_type = Val{:central},
56
56
linsolve = nothing,
57
- precs = DEFAULT_PRECS,
58
57
""" * extra_keyword_default
59
58
60
59
keyword_default_description = """
@@ -78,41 +77,7 @@ function rosenbrock_wanner_docstring(description::String,
78
77
For example, to use [KLU.jl](https://github.com/JuliaSparse/KLU.jl), specify
79
78
`$name (linsolve = KLUFactorization()`).
80
79
When `nothing` is passed, uses `DefaultLinearSolver`.
81
- - `precs`: Any [LinearSolve.jl-compatible preconditioner](https://docs.sciml.ai/LinearSolve/stable/basics/Preconditioners/)
82
- can be used as a left or right preconditioner.
83
- Preconditioners are specified by the `Pl,Pr = precs(W,du,u,p,t,newW,Plprev,Prprev,solverdata)`
84
- function where the arguments are defined as:
85
- - `W`: the current Jacobian of the nonlinear system. Specified as either
86
- ``I - \\ gamma J`` or ``I/\\ gamma - J`` depending on the algorithm. This will
87
- commonly be a `WOperator` type defined by OrdinaryDiffEq.jl. It is a lazy
88
- representation of the operator. Users can construct the W-matrix on demand
89
- by calling `convert(AbstractMatrix,W)` to receive an `AbstractMatrix` matching
90
- the `jac_prototype`.
91
- - `du`: the current ODE derivative
92
- - `u`: the current ODE state
93
- - `p`: the ODE parameters
94
- - `t`: the current ODE time
95
- - `newW`: a `Bool` which specifies whether the `W` matrix has been updated since
96
- the last call to `precs`. It is recommended that this is checked to only
97
- update the preconditioner when `newW == true`.
98
- - `Plprev`: the previous `Pl`.
99
- - `Prprev`: the previous `Pr`.
100
- - `solverdata`: Optional extra data the solvers can give to the `precs` function.
101
- Solver-dependent and subject to change.
102
- The return is a tuple `(Pl,Pr)` of the LinearSolve.jl-compatible preconditioners.
103
- To specify one-sided preconditioning, simply return `nothing` for the preconditioner
104
- which is not used. Additionally, `precs` must supply the dispatch:
105
- ```julia
106
- Pl, Pr = precs(W, du, u, p, t, ::Nothing, ::Nothing, ::Nothing, solverdata)
107
- ```
108
- which is used in the solver setup phase to construct the integrator
109
- type with the preconditioners `(Pl,Pr)`.
110
- The default is `precs=DEFAULT_PRECS` where the default preconditioner function
111
- is defined as:
112
- ```julia
113
- DEFAULT_PRECS(W, du, u, p, t, newW, Plprev, Prprev, solverdata) = nothing, nothing
114
- ```
115
- """ * extra_keyword_description
80
+ """ * extra_keyword_description
116
81
117
82
if with_step_limiter
118
83
keyword_default *= " step_limiter! = OrdinaryDiffEq.trivial_limiter!,\n "
@@ -152,41 +117,7 @@ function rosenbrock_docstring(description::String,
152
117
For example, to use [KLU.jl](https://github.com/JuliaSparse/KLU.jl), specify
153
118
`$name (linsolve = KLUFactorization()`).
154
119
When `nothing` is passed, uses `DefaultLinearSolver`.
155
- - `precs`: Any [LinearSolve.jl-compatible preconditioner](https://docs.sciml.ai/LinearSolve/stable/basics/Preconditioners/)
156
- can be used as a left or right preconditioner.
157
- Preconditioners are specified by the `Pl,Pr = precs(W,du,u,p,t,newW,Plprev,Prprev,solverdata)`
158
- function where the arguments are defined as:
159
- - `W`: the current Jacobian of the nonlinear system. Specified as either
160
- ``I - \\ gamma J`` or ``I/\\ gamma - J`` depending on the algorithm. This will
161
- commonly be a `WOperator` type defined by OrdinaryDiffEq.jl. It is a lazy
162
- representation of the operator. Users can construct the W-matrix on demand
163
- by calling `convert(AbstractMatrix,W)` to receive an `AbstractMatrix` matching
164
- the `jac_prototype`.
165
- - `du`: the current ODE derivative
166
- - `u`: the current ODE state
167
- - `p`: the ODE parameters
168
- - `t`: the current ODE time
169
- - `newW`: a `Bool` which specifies whether the `W` matrix has been updated since
170
- the last call to `precs`. It is recommended that this is checked to only
171
- update the preconditioner when `newW == true`.
172
- - `Plprev`: the previous `Pl`.
173
- - `Prprev`: the previous `Pr`.
174
- - `solverdata`: Optional extra data the solvers can give to the `precs` function.
175
- Solver-dependent and subject to change.
176
- The return is a tuple `(Pl,Pr)` of the LinearSolve.jl-compatible preconditioners.
177
- To specify one-sided preconditioning, simply return `nothing` for the preconditioner
178
- which is not used. Additionally, `precs` must supply the dispatch:
179
- ```julia
180
- Pl, Pr = precs(W, du, u, p, t, ::Nothing, ::Nothing, ::Nothing, solverdata)
181
- ```
182
- which is used in the solver setup phase to construct the integrator
183
- type with the preconditioners `(Pl,Pr)`.
184
- The default is `precs=DEFAULT_PRECS` where the default preconditioner function
185
- is defined as:
186
- ```julia
187
- DEFAULT_PRECS(W, du, u, p, t, newW, Plprev, Prprev, solverdata) = nothing, nothing
188
- ```
189
- """ * extra_keyword_default
120
+ """ * extra_keyword_default
190
121
191
122
keyword_default_description = """
192
123
- `chunk_size`: TBD
@@ -195,7 +126,6 @@ function rosenbrock_docstring(description::String,
195
126
- `concrete_jac`: function of the form `jac!(J, u, p, t)`
196
127
- `diff_type`: TBD
197
128
- `linsolve`: custom solver for the inner linear systems
198
- - `precs`: custom preconditioner for the inner linear solver
199
129
""" * extra_keyword_description
200
130
201
131
if with_step_limiter
0 commit comments