@@ -488,8 +488,7 @@ mutable struct AdaptiveRadauConstantCache{F, Tab, Tol, Dt, U, JType} <:
488488 J:: JType
489489 num_stages:: Int
490490 step:: Int
491- θ:: BigFloat
492- θprev:: BigFloat
491+ hist_iter:: Float64
493492end
494493
495494function alg_cache (alg:: AdaptiveRadau , u, rate_prototype, :: Type{uEltypeNoUnits} ,
@@ -515,11 +514,11 @@ function alg_cache(alg::AdaptiveRadau, u, rate_prototype, ::Type{uEltypeNoUnits}
515514 κ = alg. κ != = nothing ? convert (uToltype, alg. κ) : convert (uToltype, 1 // 100 )
516515 J = false .* _vec (rate_prototype) .* _vec (rate_prototype)'
517516 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 )
519518end
520519
521520mutable 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} < :
523522 FIRKMutableCache
524523 u:: uType
525524 uprev:: uType
@@ -551,6 +550,7 @@ mutable struct AdaptiveRadauCache{uType, cuType, tType, uNoUnitsType, rateType,
551550 jac_config:: JC
552551 linsolve1:: F1 # real
553552 linsolve2:: Vector{F2} # complex
553+ # linres2::Vector{F3}
554554 rtol:: rTol
555555 atol:: aTol
556556 dtprev:: Dt
@@ -559,8 +559,7 @@ mutable struct AdaptiveRadauCache{uType, cuType, tType, uNoUnitsType, rateType,
559559 step_limiter!:: StepLimiter
560560 num_stages:: Int
561561 step:: Int
562- θ:: BigFloat
563- θprev:: BigFloat
562+ hist_iter:: Float64
564563end
565564
566565function alg_cache (alg:: AdaptiveRadau , u, rate_prototype, :: Type{uEltypeNoUnits} ,
@@ -598,24 +597,19 @@ function alg_cache(alg::AdaptiveRadau, u, rate_prototype, ::Type{uEltypeNoUnits}
598597 recursivefill! .(dw2, false )
599598 cubuff = [similar (u, Complex{eltype (u)}) for _ in 1 : (max - 1 ) ÷ 2 ]
600599 recursivefill! .(cubuff, false )
601- dw = Vector {typeof (u)} (undef, max - 1 )
600+ dw = [ zero (u) for i in 1 : max]
602601
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]
607603
608604 derivatives = Matrix {typeof(u)} (undef, max, max)
609605 for i in 1 : max, j in 1 : max
610606 derivatives[i, j] = zero (u)
611607 end
612608
613609 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+
619613 k = ks[1 ]
620614
621615 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}
642636 linsolve2 = [
643637 init (LinearProblem (W2[i], _vec (cubuff[i]); u0 = _vec (dw2[i])), alg. linsolve, alias_A = true , alias_b = true ,
644638 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+ =#
646647 rtol = reltol isa Number ? reltol : zero (reltol)
647648 atol = reltol isa Number ? reltol : zero (reltol)
648649
@@ -652,7 +653,7 @@ function alg_cache(alg::AdaptiveRadau, u, rate_prototype, ::Type{uEltypeNoUnits}
652653 J, W1, W2,
653654 uf, tabs, κ, one (uToltype), 10000 , tmp,
654655 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 )
657658end
658659
0 commit comments