You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Specialize on deriv type and Rosenbrock tableau types for trim compatibility
Backport of #3326 minus the initdt changes (the v6-backport branch already
fixes that via eltype(t) inside the function body, so the ::Type{_tType}
dispatch from the original PR no longer applies).
- Specialize ode_interpolant, default_ode_interpolant, composite_ode_interpolant
and interp_at_saveat on ::Type{deriv} to force compiler specialization
- Specialize Rosenbrock tableau constructors on ::Type{T}/::Type{T2} so Julia
propagates the concrete element type through the tableau builders
These changes close dynamic-dispatch paths that cause --trim=safe (JuliaC AOT)
to fail, by adding type parameters that let the compiler statically resolve
method calls.
Co-Authored-By: Chris Rackauckas <accounts@chrisrackauckas.com>
Reference: Lang, J., & Verwer, J. G. (2001). ROS3P—an accurate third-order Rosenbrock solver designed for parabolic problems. BIT Numerical Mathematics, 41, 731-738.
410
410
"""
411
-
functionROS3PRodasTableau(T, T2)
411
+
functionROS3PRodasTableau(::Type{T}, ::Type{T2}) where {T, T2}
412
412
gamma =convert(T2, 1/2+sqrt(3) /6)
413
413
igamma =inv(gamma)
414
414
a21 =convert(T, igamma)
@@ -456,7 +456,7 @@ end
456
456
A 3rd order Rosenbrock method with 4 stages.
457
457
Reference: Sandu, A., et al. (1997). Benchmarking stiff ode solvers for atmospheric chemistry problems-I. implicit vs explicit. Atmospheric Environment, 31(19), 3151-3166.
458
458
"""
459
-
functionRodas3RodasTableau(T, T2)
459
+
functionRodas3RodasTableau(::Type{T}, ::Type{T2}) where {T, T2}
460
460
A =zeros(T, 4, 4)
461
461
A[2, 1] =convert(T, 0)
462
462
A[3, 1] =convert(T, 2)
@@ -491,7 +491,7 @@ end
491
491
A 3rd order Rosenbrock method with 5 stages, including a dense output matrix H.
492
492
Reference: Steinebach, G. (2024). Rosenbrock methods within OrdinaryDiffEq.jl - Overview, recent developments and applications. Proceedings of the JuliaCon Conferences.
493
493
"""
494
-
functionRodas3PRodasTableau(T, T2)
494
+
functionRodas3PRodasTableau(::Type{T}, ::Type{T2}) where {T, T2}
495
495
gamma =convert(T2, 1//3)
496
496
a21 =convert(T, 4.0/3.0)
497
497
a41 =convert(T, 2.90625)
@@ -553,7 +553,7 @@ end
553
553
A W-method variant of Rodas3P, providing 2nd order solutions with 5 stages.
554
554
Reference: Steinebach, G. (2024). Rosenbrock methods within OrdinaryDiffEq.jl - Overview, recent developments and applications. Proceedings of the JuliaCon Conferences.
555
555
"""
556
-
functionRodas23WRodasTableau(T, T2)
556
+
functionRodas23WRodasTableau(::Type{T}, ::Type{T2}) where {T, T2}
557
557
gamma =convert(T2, 1//3)
558
558
a21 =convert(T, 4.0/3.0)
559
559
a41 =convert(T, 2.90625)
@@ -614,7 +614,7 @@ end
614
614
615
615
A 4th order Rosenbrock method developed by Shampine.
616
616
"""
617
-
functionRosShamp4RodasTableau(T, T2)
617
+
functionRosShamp4RodasTableau(::Type{T}, ::Type{T2}) where {T, T2}
618
618
gamma =convert(T2, 1//2)
619
619
A =zeros(T, 4, 4)
620
620
A[2, 1] =convert(T, 2.0)
@@ -642,7 +642,7 @@ end
642
642
643
643
A 4th order Rosenbrock method by van Veldhuizen.
644
644
"""
645
-
functionVeldd4RodasTableau(T, T2)
645
+
functionVeldd4RodasTableau(::Type{T}, ::Type{T2}) where {T, T2}
646
646
gamma =convert(T2, 0.2257081148225682)
647
647
A =zeros(T, 4, 4)
648
648
A[2, 1] =convert(T, 2.0)
@@ -665,7 +665,7 @@ function Veldd4RodasTableau(T, T2)
0 commit comments