Skip to content

Commit 95cbe6e

Browse files
committed
cleanup
1 parent 6708b58 commit 95cbe6e

File tree

14 files changed

+18
-201
lines changed

14 files changed

+18
-201
lines changed

lib/OrdinaryDiffEqBDF/src/OrdinaryDiffEqBDF.jl

Lines changed: 1 addition & 2 deletions
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

Lines changed: 4 additions & 40 deletions
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

Lines changed: 0 additions & 2 deletions
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

Lines changed: 1 addition & 35 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 1 addition & 2 deletions
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

Lines changed: 1 addition & 2 deletions
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

Lines changed: 1 addition & 1 deletion
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

Lines changed: 3 additions & 73 deletions
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!,
@@ -52,7 +52,6 @@ function rosenbrock_wanner_docstring(description::String,
5252
concrete_jac = nothing,
5353
diff_type = Val{:central},
5454
linsolve = nothing,
55-
precs = DEFAULT_PRECS,
5655
""" * extra_keyword_default
5756

5857
keyword_default_description = """
@@ -76,41 +75,7 @@ function rosenbrock_wanner_docstring(description::String,
7675
For example, to use [KLU.jl](https://github.com/JuliaSparse/KLU.jl), specify
7776
`$name(linsolve = KLUFactorization()`).
7877
When `nothing` is passed, uses `DefaultLinearSolver`.
79-
- `precs`: Any [LinearSolve.jl-compatible preconditioner](https://docs.sciml.ai/LinearSolve/stable/basics/Preconditioners/)
80-
can be used as a left or right preconditioner.
81-
Preconditioners are specified by the `Pl,Pr = precs(W,du,u,p,t,newW,Plprev,Prprev,solverdata)`
82-
function where the arguments are defined as:
83-
- `W`: the current Jacobian of the nonlinear system. Specified as either
84-
``I - \\gamma J`` or ``I/\\gamma - J`` depending on the algorithm. This will
85-
commonly be a `WOperator` type defined by OrdinaryDiffEq.jl. It is a lazy
86-
representation of the operator. Users can construct the W-matrix on demand
87-
by calling `convert(AbstractMatrix,W)` to receive an `AbstractMatrix` matching
88-
the `jac_prototype`.
89-
- `du`: the current ODE derivative
90-
- `u`: the current ODE state
91-
- `p`: the ODE parameters
92-
- `t`: the current ODE time
93-
- `newW`: a `Bool` which specifies whether the `W` matrix has been updated since
94-
the last call to `precs`. It is recommended that this is checked to only
95-
update the preconditioner when `newW == true`.
96-
- `Plprev`: the previous `Pl`.
97-
- `Prprev`: the previous `Pr`.
98-
- `solverdata`: Optional extra data the solvers can give to the `precs` function.
99-
Solver-dependent and subject to change.
100-
The return is a tuple `(Pl,Pr)` of the LinearSolve.jl-compatible preconditioners.
101-
To specify one-sided preconditioning, simply return `nothing` for the preconditioner
102-
which is not used. Additionally, `precs` must supply the dispatch:
103-
```julia
104-
Pl, Pr = precs(W, du, u, p, t, ::Nothing, ::Nothing, ::Nothing, solverdata)
105-
```
106-
which is used in the solver setup phase to construct the integrator
107-
type with the preconditioners `(Pl,Pr)`.
108-
The default is `precs=DEFAULT_PRECS` where the default preconditioner function
109-
is defined as:
110-
```julia
111-
DEFAULT_PRECS(W, du, u, p, t, newW, Plprev, Prprev, solverdata) = nothing, nothing
112-
```
113-
""" * extra_keyword_description
78+
""" * extra_keyword_description
11479

11580
if with_step_limiter
11681
keyword_default *= "step_limiter! = OrdinaryDiffEq.trivial_limiter!,\n"
@@ -150,41 +115,7 @@ function rosenbrock_docstring(description::String,
150115
For example, to use [KLU.jl](https://github.com/JuliaSparse/KLU.jl), specify
151116
`$name(linsolve = KLUFactorization()`).
152117
When `nothing` is passed, uses `DefaultLinearSolver`.
153-
- `precs`: Any [LinearSolve.jl-compatible preconditioner](https://docs.sciml.ai/LinearSolve/stable/basics/Preconditioners/)
154-
can be used as a left or right preconditioner.
155-
Preconditioners are specified by the `Pl,Pr = precs(W,du,u,p,t,newW,Plprev,Prprev,solverdata)`
156-
function where the arguments are defined as:
157-
- `W`: the current Jacobian of the nonlinear system. Specified as either
158-
``I - \\gamma J`` or ``I/\\gamma - J`` depending on the algorithm. This will
159-
commonly be a `WOperator` type defined by OrdinaryDiffEq.jl. It is a lazy
160-
representation of the operator. Users can construct the W-matrix on demand
161-
by calling `convert(AbstractMatrix,W)` to receive an `AbstractMatrix` matching
162-
the `jac_prototype`.
163-
- `du`: the current ODE derivative
164-
- `u`: the current ODE state
165-
- `p`: the ODE parameters
166-
- `t`: the current ODE time
167-
- `newW`: a `Bool` which specifies whether the `W` matrix has been updated since
168-
the last call to `precs`. It is recommended that this is checked to only
169-
update the preconditioner when `newW == true`.
170-
- `Plprev`: the previous `Pl`.
171-
- `Prprev`: the previous `Pr`.
172-
- `solverdata`: Optional extra data the solvers can give to the `precs` function.
173-
Solver-dependent and subject to change.
174-
The return is a tuple `(Pl,Pr)` of the LinearSolve.jl-compatible preconditioners.
175-
To specify one-sided preconditioning, simply return `nothing` for the preconditioner
176-
which is not used. Additionally, `precs` must supply the dispatch:
177-
```julia
178-
Pl, Pr = precs(W, du, u, p, t, ::Nothing, ::Nothing, ::Nothing, solverdata)
179-
```
180-
which is used in the solver setup phase to construct the integrator
181-
type with the preconditioners `(Pl,Pr)`.
182-
The default is `precs=DEFAULT_PRECS` where the default preconditioner function
183-
is defined as:
184-
```julia
185-
DEFAULT_PRECS(W, du, u, p, t, newW, Plprev, Prprev, solverdata) = nothing, nothing
186-
```
187-
""" * extra_keyword_default
118+
""" * extra_keyword_default
188119

189120
keyword_default_description = """
190121
- `chunk_size`: TBD
@@ -193,7 +124,6 @@ function rosenbrock_docstring(description::String,
193124
- `concrete_jac`: function of the form `jac!(J, u, p, t)`
194125
- `diff_type`: TBD
195126
- `linsolve`: custom solver for the inner linear systems
196-
- `precs`: custom preconditioner for the inner linear solver
197127
""" * extra_keyword_description
198128

199129
if with_step_limiter

0 commit comments

Comments
 (0)