@@ -488,8 +488,7 @@ mutable struct AdaptiveRadauConstantCache{F, Tab, Tol, Dt, U, JType} <:
488
488
J:: JType
489
489
num_stages:: Int
490
490
step:: Int
491
- θ:: BigFloat
492
- θprev:: BigFloat
491
+ hist_iter:: Float64
493
492
end
494
493
495
494
function alg_cache (alg:: AdaptiveRadau , u, rate_prototype, :: Type{uEltypeNoUnits} ,
@@ -515,11 +514,11 @@ function alg_cache(alg::AdaptiveRadau, u, rate_prototype, ::Type{uEltypeNoUnits}
515
514
κ = alg. κ != = nothing ? convert (uToltype, alg. κ) : convert (uToltype, 1 // 100 )
516
515
J = false .* _vec (rate_prototype) .* _vec (rate_prototype)'
517
516
AdaptiveRadauConstantCache (uf, tabs, κ, one (uToltype), 10000 , cont, dt, dt,
518
- Convergence, J, num_stages, 1 , big " 1.0 " , big " 1.0 " )
517
+ Convergence, J, num_stages, 1 , 0.0 )
519
518
end
520
519
521
520
mutable struct AdaptiveRadauCache{uType, cuType, tType, uNoUnitsType, rateType, JType, W1Type, W2Type,
522
- UF, JC, F1, F2, Tab, Tol, Dt, rTol, aTol, StepLimiter} < :
521
+ UF, JC, F1, F2, #= F3, =# Tab, Tol, Dt, rTol, aTol, StepLimiter} < :
523
522
FIRKMutableCache
524
523
u:: uType
525
524
uprev:: uType
@@ -551,6 +550,7 @@ mutable struct AdaptiveRadauCache{uType, cuType, tType, uNoUnitsType, rateType,
551
550
jac_config:: JC
552
551
linsolve1:: F1 # real
553
552
linsolve2:: Vector{F2} # complex
553
+ # linres2::Vector{F3}
554
554
rtol:: rTol
555
555
atol:: aTol
556
556
dtprev:: Dt
@@ -559,8 +559,7 @@ mutable struct AdaptiveRadauCache{uType, cuType, tType, uNoUnitsType, rateType,
559
559
step_limiter!:: StepLimiter
560
560
num_stages:: Int
561
561
step:: Int
562
- θ:: BigFloat
563
- θprev:: BigFloat
562
+ hist_iter:: Float64
564
563
end
565
564
566
565
function alg_cache (alg:: AdaptiveRadau , u, rate_prototype, :: Type{uEltypeNoUnits} ,
@@ -598,24 +597,19 @@ function alg_cache(alg::AdaptiveRadau, u, rate_prototype, ::Type{uEltypeNoUnits}
598
597
recursivefill! .(dw2, false )
599
598
cubuff = [similar (u, Complex{eltype (u)}) for _ in 1 : (max - 1 ) ÷ 2 ]
600
599
recursivefill! .(cubuff, false )
601
- dw = Vector {typeof (u)} (undef, max - 1 )
600
+ dw = [ zero (u) for i in 1 : max]
602
601
603
- cont = Vector {typeof(u)} (undef, max)
604
- for i in 1 : max
605
- cont[i] = zero (u)
606
- end
602
+ cont = [zero (u) for i in 1 : max]
607
603
608
604
derivatives = Matrix {typeof(u)} (undef, max, max)
609
605
for i in 1 : max, j in 1 : max
610
606
derivatives[i, j] = zero (u)
611
607
end
612
608
613
609
fsalfirst = zero (rate_prototype)
614
- fw = Vector {typeof(rate_prototype)} (undef, max)
615
- ks = Vector {typeof(rate_prototype)} (undef, max)
616
- for i in 1 : max
617
- ks[i] = fw[i] = zero (rate_prototype)
618
- end
610
+ fw = [zero (rate_prototype) for i in 1 : max]
611
+ ks = [zero (rate_prototype) for i in 1 : max]
612
+
619
613
k = ks[1 ]
620
614
621
615
J, W1 = build_J_W (alg, u, uprev, p, t, dt, f, uEltypeNoUnits, Val (true ))
@@ -642,7 +636,14 @@ function alg_cache(alg::AdaptiveRadau, u, rate_prototype, ::Type{uEltypeNoUnits}
642
636
linsolve2 = [
643
637
init (LinearProblem (W2[i], _vec (cubuff[i]); u0 = _vec (dw2[i])), alg. linsolve, alias_A = true , alias_b = true ,
644
638
assumptions = LinearSolve. OperatorAssumptions (true )) for i in 1 : (max - 1 ) ÷ 2 ]
645
-
639
+ #=
640
+ linres_tmp = dolinsolve(nothing, linsolve2[1]; A = W2[1], b = _vec(cubuff[1]), linu = _vec(dw2[1]))
641
+ linres2 = Vector{typeof(linres_tmp)}(undef , (max - 1) ÷ 2)
642
+ linres2[1] = linres_tmp
643
+ for i in 2 : (num_stages - 1) ÷ 2
644
+ linres2[i] = dolinsolve(nothing, linsolve2[1]; A = W2[1], b = _vec(cubuff[i]), linu = _vec(dw2[i]))
645
+ end
646
+ =#
646
647
rtol = reltol isa Number ? reltol : zero (reltol)
647
648
atol = reltol isa Number ? reltol : zero (reltol)
648
649
@@ -652,7 +653,7 @@ function alg_cache(alg::AdaptiveRadau, u, rate_prototype, ::Type{uEltypeNoUnits}
652
653
J, W1, W2,
653
654
uf, tabs, κ, one (uToltype), 10000 , tmp,
654
655
atmp, jac_config,
655
- linsolve1, linsolve2, rtol, atol, dt, dt,
656
- Convergence, alg. step_limiter!, num_stages, 1 , big " 1.0 " , big " 1.0 " )
656
+ linsolve1, linsolve2, #= linres2, =# rtol, atol, dt, dt,
657
+ Convergence, alg. step_limiter!, num_stages, 1 , 0.0 )
657
658
end
658
659
0 commit comments