Skip to content

Commit 5bf3cdf

Browse files
committed
cleanup
1 parent 76e47ec commit 5bf3cdf

File tree

14 files changed

+18
-201
lines changed

14 files changed

+18
-201
lines changed

lib/OrdinaryDiffEqBDF/src/OrdinaryDiffEqBDF.jl

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ import OrdinaryDiffEqCore: alg_order, calculate_residuals!,
77
OrdinaryDiffEqMutableCache, OrdinaryDiffEqConstantCache,
88
OrdinaryDiffEqNewtonAdaptiveAlgorithm,
99
OrdinaryDiffEqNewtonAlgorithm,
10-
AbstractController, DEFAULT_PRECS,
11-
CompiledFloats, uses_uprev,
10+
AbstractController, CompiledFloats, uses_uprev,
1211
alg_cache, _vec, _reshape, @cache,
1312
isfsal, full_cache,
1413
constvalue, isadaptive, error_constant,

lib/OrdinaryDiffEqBDF/src/algorithms.jl

+4-40
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ function BDF_docstring(description::String,
1010
concrete_jac = nothing,
1111
diff_type = Val{:forward},
1212
linsolve = nothing,
13-
precs = DEFAULT_PRECS,
1413
""" * "\n" * extra_keyword_default
1514

1615
keyword_default_description = """
@@ -34,40 +33,6 @@ function BDF_docstring(description::String,
3433
For example, to use [KLU.jl](https://github.com/JuliaSparse/KLU.jl), specify
3534
`$name(linsolve = KLUFactorization()`).
3635
When `nothing` is passed, uses `DefaultLinearSolver`.
37-
- `precs`: Any [LinearSolve.jl-compatible preconditioner](https://docs.sciml.ai/LinearSolve/stable/basics/Preconditioners/)
38-
can be used as a left or right preconditioner.
39-
Preconditioners are specified by the `Pl,Pr = precs(W,du,u,p,t,newW,Plprev,Prprev,solverdata)`
40-
function where the arguments are defined as:
41-
- `W`: the current Jacobian of the nonlinear system. Specified as either
42-
``I - \\gamma J`` or ``I/\\gamma - J`` depending on the algorithm. This will
43-
commonly be a `WOperator` type defined by OrdinaryDiffEq.jl. It is a lazy
44-
representation of the operator. Users can construct the W-matrix on demand
45-
by calling `convert(AbstractMatrix,W)` to receive an `AbstractMatrix` matching
46-
the `jac_prototype`.
47-
- `du`: the current ODE derivative
48-
- `u`: the current ODE state
49-
- `p`: the ODE parameters
50-
- `t`: the current ODE time
51-
- `newW`: a `Bool` which specifies whether the `W` matrix has been updated since
52-
the last call to `precs`. It is recommended that this is checked to only
53-
update the preconditioner when `newW == true`.
54-
- `Plprev`: the previous `Pl`.
55-
- `Prprev`: the previous `Pr`.
56-
- `solverdata`: Optional extra data the solvers can give to the `precs` function.
57-
Solver-dependent and subject to change.
58-
The return is a tuple `(Pl,Pr)` of the LinearSolve.jl-compatible preconditioners.
59-
To specify one-sided preconditioning, simply return `nothing` for the preconditioner
60-
which is not used. Additionally, `precs` must supply the dispatch:
61-
```julia
62-
Pl, Pr = precs(W, du, u, p, t, ::Nothing, ::Nothing, ::Nothing, solverdata)
63-
```
64-
which is used in the solver setup phase to construct the integrator
65-
type with the preconditioners `(Pl,Pr)`.
66-
The default is `precs=DEFAULT_PRECS` where the default preconditioner function
67-
is defined as:
68-
```julia
69-
DEFAULT_PRECS(W, du, u, p, t, newW, Plprev, Prprev, solverdata) = nothing, nothing
70-
```
7136
""" * "/n" * extra_keyword_description
7237
generic_solver_docstring(
7338
description, name, "Multistep Method.", references,
@@ -658,17 +623,16 @@ function DABDF2(; chunk_size = Val{0}(), autodiff = Val{true}(), standardtag = V
658623
end
659624

660625
#=
661-
struct DBDF{CS,AD,F,F2,P,FDT,ST,CJ} <: DAEAlgorithm{CS,AD,FDT,ST,CJ}
626+
struct DBDF{CS,AD,F,F2,FDT,ST,CJ} <: DAEAlgorithm{CS,AD,FDT,ST,CJ}
662627
linsolve::F
663628
nlsolve::F2
664-
precs::P
665629
extrapolant::Symbol
666630
end
667631
668632
DBDF(;chunk_size=Val{0}(),autodiff=Val{true}(), standardtag = Val{true}(), concrete_jac = nothing,diff_type=Val{:forward},
669-
linsolve=nothing,precs = DEFAULT_PRECS,nlsolve=NLNewton(),extrapolant=:linear) =
670-
DBDF{_unwrap_val(chunk_size),_unwrap_val(autodiff),typeof(linsolve),typeof(nlsolve),typeof(precs),diff_type,_unwrap_val(standardtag),_unwrap_val(concrete_jac)}(
671-
linsolve,nlsolve,precs,extrapolant)
633+
linsolve=nothing,nlsolve=NLNewton(),extrapolant=:linear) =
634+
DBDF{_unwrap_val(chunk_size),_unwrap_val(autodiff),typeof(linsolve),typeof(nlsolve),diff_type,_unwrap_val(standardtag),_unwrap_val(concrete_jac)}(
635+
linsolve,nlsolve,extrapolant)
672636
=#
673637

674638
@doc BDF_docstring("Fully implicit implementation of FBDF based on Shampine's",

lib/OrdinaryDiffEqCore/src/OrdinaryDiffEqCore.jl

-2
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,6 @@ end
105105
Divergence = -2
106106
end
107107
const TryAgain = SlowConvergence
108-
109-
DEFAULT_PRECS(W, p) = nothing, nothing
110108
isdiscretecache(cache) = false
111109

112110
include("doc_utils.jl")

lib/OrdinaryDiffEqCore/src/doc_utils.jl

+1-35
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,6 @@ function differentiation_rk_docstring(description::String,
8787
concrete_jac = nothing,
8888
diff_type = Val{:forward},
8989
linsolve = nothing,
90-
precs = DEFAULT_PRECS,
9190
""" * extra_keyword_default
9291

9392
keyword_default_description = """
@@ -111,40 +110,7 @@ function differentiation_rk_docstring(description::String,
111110
For example, to use [KLU.jl](https://github.com/JuliaSparse/KLU.jl), specify
112111
`$name(linsolve = KLUFactorization()`).
113112
When `nothing` is passed, uses `DefaultLinearSolver`.
114-
- `precs`: Any [LinearSolve.jl-compatible preconditioner](https://docs.sciml.ai/LinearSolve/stable/basics/Preconditioners/)
115-
can be used as a left or right preconditioner.
116-
Preconditioners are specified by the `Pl,Pr = precs(W,du,u,p,t,newW,Plprev,Prprev,solverdata)`
117-
function where the arguments are defined as:
118-
- `W`: the current Jacobian of the nonlinear system. Specified as either
119-
``I - \\gamma J`` or ``I/\\gamma - J`` depending on the algorithm. This will
120-
commonly be a `WOperator` type defined by OrdinaryDiffEq.jl. It is a lazy
121-
representation of the operator. Users can construct the W-matrix on demand
122-
by calling `convert(AbstractMatrix,W)` to receive an `AbstractMatrix` matching
123-
the `jac_prototype`.
124-
- `du`: the current ODE derivative
125-
- `u`: the current ODE state
126-
- `p`: the ODE parameters
127-
- `t`: the current ODE time
128-
- `newW`: a `Bool` which specifies whether the `W` matrix has been updated since
129-
the last call to `precs`. It is recommended that this is checked to only
130-
update the preconditioner when `newW == true`.
131-
- `Plprev`: the previous `Pl`.
132-
- `Prprev`: the previous `Pr`.
133-
- `solverdata`: Optional extra data the solvers can give to the `precs` function.
134-
Solver-dependent and subject to change.
135-
The return is a tuple `(Pl,Pr)` of the LinearSolve.jl-compatible preconditioners.
136-
To specify one-sided preconditioning, simply return `nothing` for the preconditioner
137-
which is not used. Additionally, `precs` must supply the dispatch:
138-
```julia
139-
Pl, Pr = precs(W, du, u, p, t, ::Nothing, ::Nothing, ::Nothing, solverdata)
140-
```
141-
which is used in the solver setup phase to construct the integrator
142-
type with the preconditioners `(Pl,Pr)`.
143-
The default is `precs=DEFAULT_PRECS` where the default preconditioner function
144-
is defined as:
145-
```julia
146-
DEFAULT_PRECS(W, du, u, p, t, newW, Plprev, Prprev, solverdata) = nothing, nothing
147-
```
113+
148114
""" * extra_keyword_description
149115

150116
generic_solver_docstring(

lib/OrdinaryDiffEqExtrapolation/src/OrdinaryDiffEqExtrapolation.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import OrdinaryDiffEqCore: alg_order, alg_maximum_order, get_current_adaptive_or
1313
OrdinaryDiffEqAdaptiveAlgorithm,
1414
OrdinaryDiffEqAdaptiveImplicitAlgorithm,
1515
alg_cache, CompiledFloats, @threaded, stepsize_controller!,
16-
DEFAULT_PRECS, full_cache,
16+
full_cache,
1717
constvalue, PolyesterThreads, Sequential, BaseThreads,
1818
_digest_beta1_beta2, timedepentdtmin, _unwrap_val,
1919
_reshape, _vec, get_fsalfirstlast, generic_solver_docstring,

lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import OrdinaryDiffEqCore: alg_order, calculate_residuals!,
1010
constvalue, _unwrap_val,
1111
differentiation_rk_docstring, trivial_limiter!,
1212
_ode_interpolant!, _ode_addsteps!, AbstractController,
13-
qmax_default, alg_adaptive_order, DEFAULT_PRECS,
13+
qmax_default, alg_adaptive_order,
1414
stepsize_controller!, step_accept_controller!,
1515
step_reject_controller!,
1616
PredictiveController, alg_can_repeat_jac, NewtonAlgorithm,

lib/OrdinaryDiffEqIMEXMultistep/src/OrdinaryDiffEqIMEXMultistep.jl

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
module OrdinaryDiffEqIMEXMultistep
22

33
import OrdinaryDiffEqCore: alg_order, issplit, OrdinaryDiffEqNewtonAlgorithm, _unwrap_val,
4-
DEFAULT_PRECS, OrdinaryDiffEqConstantCache,
5-
OrdinaryDiffEqMutableCache,
4+
OrdinaryDiffEqConstantCache, OrdinaryDiffEqMutableCache,
65
@cache, alg_cache, initialize!, perform_step!, @unpack,
76
full_cache, get_fsalfirstlast,
87
generic_solver_docstring

lib/OrdinaryDiffEqIMEXMultistep/src/algorithms.jl

+1-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ struct CNAB2{CS, AD, F, F2, FDT, ST, CJ} <:
2424
OrdinaryDiffEqNewtonAlgorithm{CS, AD, FDT, ST, CJ}
2525
linsolve::F
2626
nlsolve::F2
27-
precs::P
2827
extrapolant::Symbol
2928
end
3029

@@ -58,7 +57,7 @@ end
5857
pages={263--276},
5958
year={2015},
6059
publisher={Elsevier}}", "", "")
61-
struct CNLF2{CS, AD, F, F2, P, FDT, ST, CJ} <:
60+
struct CNLF2{CS, AD, F, F2, FDT, ST, CJ} <:
6261
OrdinaryDiffEqNewtonAlgorithm{CS, AD, FDT, ST, CJ}
6362
linsolve::F
6463
nlsolve::F2

lib/OrdinaryDiffEqPDIRK/src/OrdinaryDiffEqPDIRK.jl

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ module OrdinaryDiffEqPDIRK
33
import OrdinaryDiffEqCore: isfsal, alg_order, _unwrap_val,
44
OrdinaryDiffEqNewtonAlgorithm, OrdinaryDiffEqConstantCache,
55
OrdinaryDiffEqMutableCache, constvalue, alg_cache,
6-
uses_uprev, @unpack, unwrap_alg, @cache, DEFAULT_PRECS,
6+
uses_uprev, @unpack, unwrap_alg, @cache,
77
@threaded, initialize!, perform_step!, isthreaded,
88
full_cache, get_fsalfirstlast, differentiation_rk_docstring
99
import StaticArrays: SVector

lib/OrdinaryDiffEqRosenbrock/src/OrdinaryDiffEqRosenbrock.jl

+3-73
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module OrdinaryDiffEqRosenbrock
22

33
import OrdinaryDiffEqCore: alg_order, alg_adaptive_order, isWmethod, isfsal, _unwrap_val,
4-
DEFAULT_PRECS, OrdinaryDiffEqRosenbrockAlgorithm, @cache,
4+
OrdinaryDiffEqRosenbrockAlgorithm, @cache,
55
alg_cache, initialize!, @unpack,
66
calculate_residuals!, OrdinaryDiffEqMutableCache,
77
OrdinaryDiffEqConstantCache, _ode_interpolant, _ode_interpolant!,
@@ -54,7 +54,6 @@ function rosenbrock_wanner_docstring(description::String,
5454
concrete_jac = nothing,
5555
diff_type = Val{:central},
5656
linsolve = nothing,
57-
precs = DEFAULT_PRECS,
5857
""" * extra_keyword_default
5958

6059
keyword_default_description = """
@@ -78,41 +77,7 @@ function rosenbrock_wanner_docstring(description::String,
7877
For example, to use [KLU.jl](https://github.com/JuliaSparse/KLU.jl), specify
7978
`$name(linsolve = KLUFactorization()`).
8079
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
11681

11782
if with_step_limiter
11883
keyword_default *= "step_limiter! = OrdinaryDiffEq.trivial_limiter!,\n"
@@ -152,41 +117,7 @@ function rosenbrock_docstring(description::String,
152117
For example, to use [KLU.jl](https://github.com/JuliaSparse/KLU.jl), specify
153118
`$name(linsolve = KLUFactorization()`).
154119
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
190121

191122
keyword_default_description = """
192123
- `chunk_size`: TBD
@@ -195,7 +126,6 @@ function rosenbrock_docstring(description::String,
195126
- `concrete_jac`: function of the form `jac!(J, u, p, t)`
196127
- `diff_type`: TBD
197128
- `linsolve`: custom solver for the inner linear systems
198-
- `precs`: custom preconditioner for the inner linear solver
199129
""" * extra_keyword_description
200130

201131
if with_step_limiter

lib/OrdinaryDiffEqSDIRK/src/OrdinaryDiffEqSDIRK.jl

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import OrdinaryDiffEqCore: alg_order, calculate_residuals!,
77
OrdinaryDiffEqMutableCache, OrdinaryDiffEqConstantCache,
88
OrdinaryDiffEqNewtonAdaptiveAlgorithm,
99
OrdinaryDiffEqNewtonAlgorithm,
10-
DEFAULT_PRECS,
1110
OrdinaryDiffEqAdaptiveAlgorithm, CompiledFloats, uses_uprev,
1211
alg_cache, _vec, _reshape, @cache, isfsal, full_cache,
1312
constvalue, _unwrap_val, _ode_interpolant,

lib/OrdinaryDiffEqSDIRK/src/algorithms.jl

+1-36
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ function SDIRK_docstring(description::String,
1010
concrete_jac = nothing,
1111
diff_type = Val{:forward},
1212
linsolve = nothing,
13-
precs = DEFAULT_PRECS,
1413
nlsolve = NLNewton(),
1514
""" * extra_keyword_default
1615

@@ -35,41 +34,7 @@ function SDIRK_docstring(description::String,
3534
For example, to use [KLU.jl](https://github.com/JuliaSparse/KLU.jl), specify
3635
`$name(linsolve = KLUFactorization()`).
3736
When `nothing` is passed, uses `DefaultLinearSolver`.
38-
- `precs`: Any [LinearSolve.jl-compatible preconditioner](https://docs.sciml.ai/LinearSolve/stable/basics/Preconditioners/)
39-
can be used as a left or right preconditioner.
40-
Preconditioners are specified by the `Pl,Pr = precs(W,du,u,p,t,newW,Plprev,Prprev,solverdata)`
41-
function where the arguments are defined as:
42-
- `W`: the current Jacobian of the nonlinear system. Specified as either
43-
``I - \\gamma J`` or ``I/\\gamma - J`` depending on the algorithm. This will
44-
commonly be a `WOperator` type defined by OrdinaryDiffEq.jl. It is a lazy
45-
representation of the operator. Users can construct the W-matrix on demand
46-
by calling `convert(AbstractMatrix,W)` to receive an `AbstractMatrix` matching
47-
the `jac_prototype`.
48-
- `du`: the current ODE derivative
49-
- `u`: the current ODE state
50-
- `p`: the ODE parameters
51-
- `t`: the current ODE time
52-
- `newW`: a `Bool` which specifies whether the `W` matrix has been updated since
53-
the last call to `precs`. It is recommended that this is checked to only
54-
update the preconditioner when `newW == true`.
55-
- `Plprev`: the previous `Pl`.
56-
- `Prprev`: the previous `Pr`.
57-
- `solverdata`: Optional extra data the solvers can give to the `precs` function.
58-
Solver-dependent and subject to change.
59-
The return is a tuple `(Pl,Pr)` of the LinearSolve.jl-compatible preconditioners.
60-
To specify one-sided preconditioning, simply return `nothing` for the preconditioner
61-
which is not used. Additionally, `precs` must supply the dispatch:
62-
```julia
63-
Pl, Pr = precs(W, du, u, p, t, ::Nothing, ::Nothing, ::Nothing, solverdata)
64-
```
65-
which is used in the solver setup phase to construct the integrator
66-
type with the preconditioners `(Pl,Pr)`.
67-
The default is `precs=DEFAULT_PRECS` where the default preconditioner function
68-
is defined as:
69-
```julia
70-
DEFAULT_PRECS(W, du, u, p, t, newW, Plprev, Prprev, solverdata) = nothing, nothing
71-
```
72-
- `nlsolve`: TBD
37+
- `nlsolve`: TBD
7338
""" * extra_keyword_description
7439

7540
generic_solver_docstring(

0 commit comments

Comments
 (0)