Skip to content

Commit d50f02f

Browse files
committed
Fix inconsistencies of type parameters of algorithms with AD settings
1 parent 786689e commit d50f02f

File tree

13 files changed

+171
-77
lines changed

13 files changed

+171
-77
lines changed

lib/OrdinaryDiffEqBDF/src/algorithms.jl

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ function ABDF2(;
119119
nlsolve = NLNewton(),
120120
smooth_est = true, extrapolant = :linear,
121121
controller = :Standard, step_limiter! = trivial_limiter!)
122-
AD_choice = _process_AD_choice(autodiff, chunk_size, diff_type)
122+
AD_choice, chunk_size, diff_type = _process_AD_choice(autodiff, chunk_size, diff_type)
123123

124124
ABDF2{
125125
_unwrap_val(chunk_size), typeof(AD_choice), typeof(linsolve), typeof(nlsolve),
@@ -177,7 +177,7 @@ function SBDF(order; chunk_size = Val{0}(), autodiff = AutoForwardDiff(),
177177
linsolve = nothing, precs = DEFAULT_PRECS, nlsolve = NLNewton(), κ = nothing,
178178
tol = nothing,
179179
extrapolant = :linear, ark = false)
180-
AD_choice = _process_AD_choice(autodiff, chunk_size, diff_type)
180+
AD_choice, chunk_size, diff_type = _process_AD_choice(autodiff, chunk_size, diff_type)
181181

182182
SBDF{_unwrap_val(chunk_size), typeof(AD_choice), typeof(linsolve), typeof(nlsolve),
183183
typeof(precs), diff_type, _unwrap_val(standardtag), _unwrap_val(concrete_jac),
@@ -200,7 +200,7 @@ function SBDF(;
200200
tol = nothing,
201201
extrapolant = :linear,
202202
order, ark = false)
203-
AD_choice = _process_AD_choice(autodiff, chunk_size, diff_type)
203+
AD_choice, chunk_size, diff_type = _process_AD_choice(autodiff, chunk_size, diff_type)
204204

205205
SBDF{_unwrap_val(chunk_size), typeof(AD_choice), typeof(linsolve), typeof(nlsolve),
206206
typeof(precs), diff_type, _unwrap_val(standardtag), _unwrap_val(concrete_jac),
@@ -306,7 +306,7 @@ function QNDF1(;
306306
linsolve = nothing, precs = DEFAULT_PRECS, nlsolve = NLNewton(),
307307
extrapolant = :linear, kappa = -37 // 200,
308308
controller = :Standard, step_limiter! = trivial_limiter!)
309-
AD_choice = _process_AD_choice(autodiff, chunk_size, diff_type)
309+
AD_choice, chunk_size, diff_type = _process_AD_choice(autodiff, chunk_size, diff_type)
310310

311311
QNDF1{
312312
_unwrap_val(chunk_size), typeof(AD_choice), typeof(linsolve), typeof(nlsolve),
@@ -366,7 +366,7 @@ function QNDF2(;
366366
linsolve = nothing, precs = DEFAULT_PRECS, nlsolve = NLNewton(),
367367
extrapolant = :linear, kappa = -1 // 9,
368368
controller = :Standard, step_limiter! = trivial_limiter!)
369-
AD_choice = _process_AD_choice(autodiff, chunk_size, diff_type)
369+
AD_choice, chunk_size, diff_type = _process_AD_choice(autodiff, chunk_size, diff_type)
370370

371371
QNDF2{
372372
_unwrap_val(chunk_size), typeof(AD_choice), typeof(linsolve), typeof(nlsolve),
@@ -436,7 +436,7 @@ function QNDF(; max_order::Val{MO} = Val{5}(), chunk_size = Val{0}(),
436436
extrapolant = :linear, kappa = (
437437
-37 // 200, -1 // 9, -823 // 10000, -83 // 2000, 0 // 1),
438438
controller = :Standard, step_limiter! = trivial_limiter!) where {MO}
439-
AD_choice = _process_AD_choice(autodiff, chunk_size, diff_type)
439+
AD_choice, chunk_size, diff_type = _process_AD_choice(autodiff, chunk_size, diff_type)
440440

441441
QNDF{MO, _unwrap_val(chunk_size), typeof(AD_choice), typeof(linsolve),
442442
typeof(nlsolve), typeof(precs), diff_type, _unwrap_val(standardtag),
@@ -482,7 +482,7 @@ function MEBDF2(;
482482
concrete_jac = nothing, diff_type = Val{:forward}(),
483483
linsolve = nothing, precs = DEFAULT_PRECS, nlsolve = NLNewton(),
484484
extrapolant = :constant)
485-
AD_choice = _process_AD_choice(autodiff, chunk_size, diff_type)
485+
AD_choice, chunk_size, diff_type = _process_AD_choice(autodiff, chunk_size, diff_type)
486486

487487
MEBDF2{_unwrap_val(chunk_size), typeof(AD_choice), typeof(linsolve),
488488
typeof(nlsolve), typeof(precs), diff_type, _unwrap_val(standardtag),
@@ -541,7 +541,7 @@ function FBDF(; max_order::Val{MO} = Val{5}(), chunk_size = Val{0}(),
541541
linsolve = nothing, precs = DEFAULT_PRECS, nlsolve = NLNewton(), κ = nothing,
542542
tol = nothing,
543543
extrapolant = :linear, controller = :Standard, step_limiter! = trivial_limiter!) where {MO}
544-
AD_choice = _process_AD_choice(autodiff, chunk_size, diff_type)
544+
AD_choice, chunk_size, diff_type = _process_AD_choice(autodiff, chunk_size, diff_type)
545545

546546
FBDF{MO, _unwrap_val(chunk_size), typeof(AD_choice), typeof(linsolve),
547547
typeof(nlsolve), typeof(precs), diff_type, _unwrap_val(standardtag),
@@ -659,7 +659,7 @@ function DImplicitEuler(;
659659
linsolve = nothing, precs = DEFAULT_PRECS, nlsolve = NLNewton(),
660660
extrapolant = :constant,
661661
controller = :Standard)
662-
AD_choice = _process_AD_choice(autodiff, chunk_size, diff_type)
662+
AD_choice, chunk_size, diff_type = _process_AD_choice(autodiff, chunk_size, diff_type)
663663

664664
DImplicitEuler{_unwrap_val(chunk_size), typeof(AD_choice), typeof(linsolve),
665665
typeof(nlsolve), typeof(precs), diff_type, _unwrap_val(standardtag),
@@ -701,7 +701,7 @@ function DABDF2(;
701701
linsolve = nothing, precs = DEFAULT_PRECS, nlsolve = NLNewton(),
702702
extrapolant = :constant,
703703
controller = :Standard)
704-
AD_choice = _process_AD_choice(autodiff, chunk_size, diff_type)
704+
AD_choice, chunk_size, diff_type = _process_AD_choice(autodiff, chunk_size, diff_type)
705705

706706
DABDF2{_unwrap_val(chunk_size), typeof(AD_choice), typeof(linsolve),
707707
typeof(nlsolve), typeof(precs), diff_type, _unwrap_val(standardtag),
@@ -764,7 +764,7 @@ function DFBDF(; max_order::Val{MO} = Val{5}(), chunk_size = Val{0}(),
764764
linsolve = nothing, precs = DEFAULT_PRECS, nlsolve = NLNewton(), κ = nothing,
765765
tol = nothing,
766766
extrapolant = :linear, controller = :Standard) where {MO}
767-
AD_choice = _process_AD_choice(autodiff, chunk_size, diff_type)
767+
AD_choice, chunk_size, diff_type = _process_AD_choice(autodiff, chunk_size, diff_type)
768768

769769
DFBDF{MO, _unwrap_val(chunk_size), typeof(AD_choice), typeof(linsolve),
770770
typeof(nlsolve), typeof(precs), diff_type, _unwrap_val(standardtag),

lib/OrdinaryDiffEqCore/src/misc_utils.jl

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -131,33 +131,41 @@ end
131131

132132
isnewton(::Any) = false
133133

134-
function _bool_to_ADType(::Val{true}, chunksize, diff_type)
134+
function _bool_to_ADType(::Val{true}, ::Val{CS}, _) where {CS}
135135
Base.depwarn(
136136
"Using a `Bool` for keyword argument `autodiff` is deprecated. Please use an `ADType` specifier.",
137137
:_bool_to_ADType)
138-
chunksize = SciMLBase._unwrap_val(chunksize) == 0 ? nothing :
139-
SciMLBase._unwrap_val(chunksize)
140-
AutoForwardDiff(chunksize = chunksize)
138+
_CS = CS === 0 ? nothing : CS
139+
return AutoForwardDiff{_CS}(nothing)
141140
end
142141

143-
function _bool_to_ADType(::Val{false}, chunksize, diff_type)
142+
function _bool_to_ADType(::Val{false}, _, ::Val{FD}) where {FD}
144143
Base.depwarn(
145144
"Using a `Bool` for keyword argument `autodiff` is deprecated. Please use an `ADType` specifier.",
146145
:_bool_to_ADType)
147-
return AutoFiniteDiff(fdtype = diff_type)
146+
return AutoFiniteDiff(; fdtype = Val{FD}())
148147
end
149148

150149
# Functions to get ADType type from Bool or ADType object, or ADType type
151-
function _process_AD_choice(ad_alg::Bool, chunksize, diff_type)
152-
_bool_to_ADType(Val(ad_alg), chunksize, diff_type)
150+
function _process_AD_choice(ad_alg::Bool, ::Val{CS}, ::Val{FD}) where {CS,FD}
151+
return _bool_to_ADType(Val(ad_alg), Val{CS}(), Val{FD}()), Val{CS}(), Val{FD}()
153152
end
154153

155-
function _process_AD_choice(ad_alg::AbstractADType, chunksize, diff_type)
156-
# need a path for if just chunksize is specified in the Algorithm construction
157-
if !(chunksize === Val{0}())
158-
@warn "The `chunksize` keyword is deprecated. Please use an `ADType` specifier. For now defaulting to using `ForwardDiff` with the given `chunksize`."
159-
return _bool_to_ADType(Val{true}(), chunksize, diff_type)
154+
function _process_AD_choice(ad_alg::AutoForwardDiff{CS}, ::Val{CS2}, ::Val{FD}) where {CS,CS2,FD}
155+
# Non-default `chunk_size`
156+
if CS2 != 0
157+
@warn "The `chunk_size` keyword is deprecated. Please use an `ADType` specifier. For now defaulting to using `AutoForwardDiff` with `chunksize=$(CS2)`."
158+
return _bool_to_ADType(Val{true}(), Val{CS2}(), Val{FD}()), Val{CS2}(), Val{FD}()
160159
end
160+
_CS = CS === nothing ? 0 : CS
161+
return ad_alg, Val{_CS}(), Val{FD}()
162+
end
161163

162-
ad_alg
164+
function _process_AD_choice(ad_alg::AutoFiniteDiff{FD}, ::Val{CS}, ::Val{FD2}) where {FD,CS,FD2}
165+
# Non-default `diff_type`
166+
if FD2 !== :forward
167+
@warn "The `diff_type` keyword is deprecated. Please use an `ADType` specifier. For now defaulting to using `AutoFiniteDiff` with `fdtype=Val{$FD2}()`."
168+
return _bool_to_ADType(Val{false}(), Val{CS}(), Val{FD2}()), Val{CS}(), Val{FD2}()
169+
end
170+
return ad_alg, Val{CS}(), ad_alg.fdtype
163171
end

lib/OrdinaryDiffEqExponentialRK/src/algorithms.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ for (Alg, Description, Ref) in [
3939
standardtag = Val{true}(), concrete_jac = nothing,
4040
chunk_size = Val{0}(),
4141
diff_type = Val{:forward}())
42-
AD_choice = _process_AD_choice(autodiff, chunk_size, diff_type)
42+
AD_choice, chunk_size, diff_type = _process_AD_choice(autodiff, chunk_size, diff_type)
4343

4444
$Alg{_unwrap_val(chunk_size), typeof(AD_choice),
4545
diff_type, _unwrap_val(standardtag), _unwrap_val(concrete_jac)}(krylov,
@@ -83,7 +83,7 @@ for (Alg, Description, Ref) in [
8383
m = 30, iop = 0, autodiff = AutoForwardDiff(), standardtag = Val{true}(),
8484
concrete_jac = nothing, chunk_size = Val{0}(),
8585
diff_type = Val{:forward}())
86-
AD_choice = _process_AD_choice(autodiff, chunk_size, diff_type)
86+
AD_choice, chunk_size, diff_type = _process_AD_choice(autodiff, chunk_size, diff_type)
8787

8888
$Alg{_unwrap_val(chunk_size), typeof(AD_choice),
8989
diff_type, _unwrap_val(standardtag),
@@ -145,7 +145,7 @@ for (Alg, Description, Ref) in [(:Exp4, "4th order EPIRK scheme.", REF3)
145145
adaptive_krylov = true, m = 30, iop = 0, autodiff = AutoForwardDiff(),
146146
standardtag = Val{true}(), concrete_jac = nothing,
147147
chunk_size = Val{0}(), diff_type = Val{:forward}())
148-
AD_choice = _process_AD_choice(autodiff, chunk_size, diff_type)
148+
AD_choice, chunk_size, diff_type = _process_AD_choice(autodiff, chunk_size, diff_type)
149149

150150
$Alg{_unwrap_val(chunk_size), typeof(AD_choice), diff_type,
151151
_unwrap_val(standardtag), _unwrap_val(concrete_jac)}(adaptive_krylov,
@@ -160,4 +160,4 @@ ETD2: Exponential Runge-Kutta Method
160160
Second order Exponential Time Differencing method (in development).
161161
"""
162162
struct ETD2 <:
163-
OrdinaryDiffEqExponentialAlgorithm{0, false, Val{:forward}, Val{true}, nothing} end
163+
OrdinaryDiffEqExponentialAlgorithm{0, false, AutoForwardDiff{nothing, Nothing}, Val{true}, nothing} end

lib/OrdinaryDiffEqExtrapolation/src/algorithms.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ function ImplicitEulerExtrapolation(; chunk_size = Val{0}(), autodiff = AutoForw
7373
precs = DEFAULT_PRECS,
7474
max_order = 12, min_order = 3, init_order = 5,
7575
threading = false, sequence = :harmonic)
76-
AD_choice = _process_AD_choice(autodiff, chunk_size, diff_type)
76+
AD_choice, chunk_size, diff_type = _process_AD_choice(autodiff, chunk_size, diff_type)
7777

7878
linsolve = (linsolve === nothing &&
7979
(threading == true || threading isa PolyesterThreads)) ?
@@ -216,7 +216,7 @@ function ImplicitDeuflhardExtrapolation(;
216216
diff_type = Val{:forward}(),
217217
min_order = 1, init_order = 5, max_order = 10,
218218
sequence = :harmonic, threading = false)
219-
AD_choice = _process_AD_choice(autodiff, chunk_size, diff_type)
219+
AD_choice, chunk_size, diff_type = _process_AD_choice(autodiff, chunk_size, diff_type)
220220

221221
# Enforce 1 <= min_order <= init_order <= max_order:
222222
min_order = max(1, min_order)
@@ -400,7 +400,7 @@ Initial order: " * lpad(init_order, 2, " ") * " --> " * lpad(init_order, 2, " ")
400400
sequence = :harmonic
401401
end
402402

403-
AD_choice = _process_AD_choice(autodiff, chunk_size, diff_type)
403+
AD_choice, chunk_size, diff_type = _process_AD_choice(autodiff, chunk_size, diff_type)
404404
# Initialize algorithm
405405
ImplicitHairerWannerExtrapolation{_unwrap_val(chunk_size), typeof(AD_choice),
406406
typeof(linsolve), typeof(precs), diff_type,
@@ -483,7 +483,7 @@ Initial order: " * lpad(init_order, 2, " ") * " --> " * lpad(init_order, 2, " ")
483483
sequence = :harmonic
484484
end
485485

486-
AD_choice = _process_AD_choice(autodiff, chunk_size, diff_type)
486+
AD_choice, chunk_size, diff_type = _process_AD_choice(autodiff, chunk_size, diff_type)
487487
# Initialize algorithm
488488
ImplicitEulerBarycentricExtrapolation{_unwrap_val(chunk_size), typeof(AD_choice),
489489
typeof(linsolve), typeof(precs), diff_type,

lib/OrdinaryDiffEqFIRK/src/algorithms.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function RadauIIA3(; chunk_size = Val{0}(), autodiff = AutoForwardDiff(),
4848
new_W_γdt_cutoff = 1 // 5,
4949
controller = :Predictive, κ = nothing, maxiters = 10,
5050
step_limiter! = trivial_limiter!)
51-
AD_choice = _process_AD_choice(autodiff, chunk_size, diff_type)
51+
AD_choice, chunk_size, diff_type = _process_AD_choice(autodiff, chunk_size, diff_type)
5252

5353
RadauIIA3{_unwrap_val(chunk_size), typeof(AD_choice), typeof(linsolve),
5454
typeof(precs), diff_type, _unwrap_val(standardtag), _unwrap_val(concrete_jac),
@@ -96,7 +96,7 @@ function RadauIIA5(; chunk_size = Val{0}(), autodiff = AutoForwardDiff(),
9696
new_W_γdt_cutoff = 1 // 5,
9797
controller = :Predictive, κ = nothing, maxiters = 10, smooth_est = true,
9898
step_limiter! = trivial_limiter!)
99-
AD_choice = _process_AD_choice(autodiff, chunk_size, diff_type)
99+
AD_choice, chunk_size, diff_type = _process_AD_choice(autodiff, chunk_size, diff_type)
100100

101101
RadauIIA5{_unwrap_val(chunk_size), typeof(AD_choice), typeof(linsolve),
102102
typeof(precs), diff_type, _unwrap_val(standardtag), _unwrap_val(concrete_jac),
@@ -145,7 +145,7 @@ function RadauIIA9(; chunk_size = Val{0}(), autodiff = AutoForwardDiff(),
145145
new_W_γdt_cutoff = 1 // 5,
146146
controller = :Predictive, κ = nothing, maxiters = 10, smooth_est = true,
147147
step_limiter! = trivial_limiter!)
148-
AD_choice = _process_AD_choice(autodiff, chunk_size, diff_type)
148+
AD_choice, chunk_size, diff_type = _process_AD_choice(autodiff, chunk_size, diff_type)
149149

150150
RadauIIA9{_unwrap_val(chunk_size), typeof(AD_choice), typeof(linsolve),
151151
typeof(precs), diff_type, _unwrap_val(standardtag), _unwrap_val(concrete_jac),
@@ -189,7 +189,7 @@ function AdaptiveRadau(; chunk_size = Val{0}(), autodiff = AutoForwardDiff(),
189189
new_W_γdt_cutoff = 1 // 5,
190190
controller = :Predictive, κ = nothing, maxiters = 10, smooth_est = true,
191191
step_limiter! = trivial_limiter!)
192-
AD_choice = _process_AD_choice(autodiff, chunk_size, diff_type)
192+
AD_choice, chunk_size, diff_type = _process_AD_choice(autodiff, chunk_size, diff_type)
193193

194194
AdaptiveRadau{_unwrap_val(chunk_size), typeof(AD_choice), typeof(linsolve),
195195
typeof(precs), diff_type, _unwrap_val(standardtag), _unwrap_val(concrete_jac),

lib/OrdinaryDiffEqIMEXMultistep/src/algorithms.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ function CNAB2(;
3434
concrete_jac = nothing, diff_type = Val{:forward}(),
3535
linsolve = nothing, precs = DEFAULT_PRECS, nlsolve = NLNewton(),
3636
extrapolant = :linear)
37-
AD_choice = _process_AD_choice(autodiff, chunk_size, diff_type)
37+
AD_choice, chunk_size, diff_type = _process_AD_choice(autodiff, chunk_size, diff_type)
3838

3939
CNAB2{
4040
_unwrap_val(chunk_size), typeof(AD_choice), typeof(linsolve), typeof(nlsolve),
@@ -78,7 +78,7 @@ function CNLF2(;
7878
concrete_jac = nothing, diff_type = Val{:forward}(),
7979
linsolve = nothing, precs = DEFAULT_PRECS, nlsolve = NLNewton(),
8080
extrapolant = :linear)
81-
AD_choice = _process_AD_choice(autodiff, chunk_size, diff_type)
81+
AD_choice, chunk_size, diff_type = _process_AD_choice(autodiff, chunk_size, diff_type)
8282

8383
CNLF2{
8484
_unwrap_val(chunk_size), typeof(AD_choice), typeof(linsolve), typeof(nlsolve),

lib/OrdinaryDiffEqLowOrderRK/src/algorithms.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
struct Euler <: OrdinaryDiffEqAlgorithm end
99

1010
struct SplitEuler <:
11-
OrdinaryDiffEqExponentialAlgorithm{0, false, Val{:forward}, Val{true}, nothing} end
11+
OrdinaryDiffEqExponentialAlgorithm{0, false, AutoForwardDiff{nothing, Nothing}, Val{true}, nothing} end
1212

1313
@doc explicit_rk_docstring(
1414
"The second order Heun's method. Uses embedded Euler method for adaptivity.",

lib/OrdinaryDiffEqPDIRK/src/algorithms.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ function PDIRK44(;
3535
concrete_jac = nothing, diff_type = Val{:forward}(),
3636
linsolve = nothing, precs = DEFAULT_PRECS, nlsolve = NLNewton(),
3737
extrapolant = :constant, threading = true)
38-
AD_choice = _process_AD_choice(autodiff, chunk_size, diff_type)
38+
AD_choice, chunk_size, diff_type = _process_AD_choice(autodiff, chunk_size, diff_type)
3939

4040
PDIRK44{_unwrap_val(chunk_size), typeof(AD_choice), typeof(linsolve),
4141
typeof(nlsolve), typeof(precs), diff_type, _unwrap_val(standardtag),

lib/OrdinaryDiffEqRosenbrock/src/OrdinaryDiffEqRosenbrock.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ function rosenbrock_wolfbrandt_docstring(description::String,
5151
standardtag = Val{true}(),
5252
autodiff = AutoForwardDiff(),
5353
concrete_jac = nothing,
54-
diff_type = Val{:central},
54+
diff_type = Val{:forward}(),
5555
linsolve = nothing,
5656
precs = DEFAULT_PRECS,
5757
""" * extra_keyword_default

lib/OrdinaryDiffEqRosenbrock/src/algorithms.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ for Alg in [
117117
diff_type = Val{:forward}(), linsolve = nothing,
118118
precs = DEFAULT_PRECS, step_limiter! = trivial_limiter!,
119119
stage_limiter! = trivial_limiter!)
120-
AD_choice = _process_AD_choice(autodiff, chunk_size, diff_type)
120+
AD_choice, chunk_size, diff_type = _process_AD_choice(autodiff, chunk_size, diff_type)
121121
$Alg{_unwrap_val(chunk_size), typeof(AD_choice), typeof(linsolve),
122122
typeof(precs), diff_type, _unwrap_val(standardtag),
123123
_unwrap_val(concrete_jac), typeof(step_limiter!),
@@ -136,7 +136,7 @@ end
136136
function GeneralRosenbrock(; chunk_size = Val{0}(), autodiff = AutoForwardDiff(),
137137
standardtag = Val{true}(), concrete_jac = nothing,
138138
factorization = lu!, tableau = ROSENBROCK_DEFAULT_TABLEAU)
139-
AD_choice = _process_AD_choice(autodiff, chunk_size, diff_type)
139+
AD_choice, chunk_size, diff_type = _process_AD_choice(autodiff, chunk_size, Val{:forward}())
140140

141141
GeneralRosenbrock{
142142
_unwrap_val(chunk_size), typeof(AD_choice), typeof(factorization),
@@ -160,10 +160,10 @@ struct RosenbrockW6S4OS{CS, AD, F, P, FDT, ST, CJ} <:
160160
end
161161
function RosenbrockW6S4OS(; chunk_size = Val{0}(), autodiff = AutoForwardDiff(),
162162
standardtag = Val{true}(),
163-
concrete_jac = nothing, diff_type = Val{:central},
163+
concrete_jac = nothing, diff_type = Val{:forward}(),
164164
linsolve = nothing,
165165
precs = DEFAULT_PRECS)
166-
AD_choice = _process_AD_choice(autodiff, chunk_size, diff_type)
166+
AD_choice, chunk_size, diff_type = _process_AD_choice(autodiff, chunk_size, diff_type)
167167

168168
RosenbrockW6S4OS{_unwrap_val(chunk_size),
169169
typeof(AD_choice), typeof(linsolve), typeof(precs), diff_type,
@@ -202,7 +202,7 @@ for Alg in [
202202
function $Alg(; chunk_size = Val{0}(), autodiff = AutoForwardDiff(),
203203
standardtag = Val{true}(), concrete_jac = nothing,
204204
diff_type = Val{:forward}(), linsolve = nothing, precs = DEFAULT_PRECS)
205-
AD_choice = _process_AD_choice(autodiff, chunk_size, diff_type)
205+
AD_choice, chunk_size, diff_type = _process_AD_choice(autodiff, chunk_size, diff_type)
206206

207207
$Alg{_unwrap_val(chunk_size), typeof(AD_choice), typeof(linsolve),
208208
typeof(precs), diff_type, _unwrap_val(standardtag),

0 commit comments

Comments
 (0)