From a7e315ac2878e3e8cd42942531bb0feb0a1cc186 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Tue, 16 Jul 2024 11:16:13 +0530 Subject: [PATCH 01/47] Added FIRK solvers --- lib/OrdinaryDiffEqFIRK/Project.toml | 4 + .../src/OrdinaryDiffEqFIRK.jl | 24 ++++ lib/OrdinaryDiffEqFIRK/src/alg_utils.jl | 7 ++ lib/OrdinaryDiffEqFIRK/src/algorithms.jl | 106 ++++++++++++++++++ lib/OrdinaryDiffEqFIRK/src/controllers.jl | 54 +++++++++ .../OrdinaryDiffEqFIRK/src}/firk_caches.jl | 0 .../src}/firk_perform_step.jl | 0 .../OrdinaryDiffEqFIRK/src}/firk_tableaus.jl | 0 .../src/integrator_interface.jl | 4 + .../test}/ode_firk_tests.jl | 2 +- lib/OrdinaryDiffEqFIRK/test/runtests.jl | 0 src/OrdinaryDiffEq.jl | 25 +---- src/alg_utils.jl | 3 - src/integrators/controllers.jl | 54 --------- src/integrators/integrator_interface.jl | 5 - test/runtests.jl | 11 +- 16 files changed, 214 insertions(+), 85 deletions(-) create mode 100644 lib/OrdinaryDiffEqFIRK/Project.toml create mode 100644 lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl create mode 100644 lib/OrdinaryDiffEqFIRK/src/alg_utils.jl create mode 100644 lib/OrdinaryDiffEqFIRK/src/algorithms.jl create mode 100644 lib/OrdinaryDiffEqFIRK/src/controllers.jl rename {src/caches => lib/OrdinaryDiffEqFIRK/src}/firk_caches.jl (100%) rename {src/perform_step => lib/OrdinaryDiffEqFIRK/src}/firk_perform_step.jl (100%) rename {src/tableaus => lib/OrdinaryDiffEqFIRK/src}/firk_tableaus.jl (100%) create mode 100644 lib/OrdinaryDiffEqFIRK/src/integrator_interface.jl rename {test/algconvergence => lib/OrdinaryDiffEqFIRK/test}/ode_firk_tests.jl (99%) create mode 100644 lib/OrdinaryDiffEqFIRK/test/runtests.jl diff --git a/lib/OrdinaryDiffEqFIRK/Project.toml b/lib/OrdinaryDiffEqFIRK/Project.toml new file mode 100644 index 0000000000..f6e415fb8f --- /dev/null +++ b/lib/OrdinaryDiffEqFIRK/Project.toml @@ -0,0 +1,4 @@ +name = "OrdinaryDiffEqFIRK" +uuid = "5960d6e9-dd7a-4743-88e7-cf307b64f125" +authors = ["ParamThakkar123 "] +version = "0.1.0" diff --git a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl new file mode 100644 index 0000000000..71b5a2d056 --- /dev/null +++ b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl @@ -0,0 +1,24 @@ +module OrdinaryDiffEqFIRK + +import OrdinaryDiffEq: alg_order, calculate_residuals!, + initialize!, perform_step!, @unpack, unwrap_alg, + calculate_residuals, + OrdinaryDiffEqAlgorithm, + OrdinaryDiffEqMutableCache, OrdinaryDiffEqConstantCache, + OrdinaryDiffEqAdaptiveAlgorithm, CompiledFloats, uses_uprev, + alg_cache, _vec, _reshape, @cache, isfsal, full_cache, + constvalue, _unwrap_val, du_alias_or_new, + explicit_rk_docstring, trivial_limiter!, + _ode_interpolant!, _ode_addsteps! + +include("algorithms.jl") +include("alg_utils.jl") +include("controllers.jl") +include("firk_caches.jl") +include("firk_tableaus.jl") +include("firk_perform_step.jl") +include("integrator_interface.jl") + +export RadauIIA3, RadauIIA5 + +end diff --git a/lib/OrdinaryDiffEqFIRK/src/alg_utils.jl b/lib/OrdinaryDiffEqFIRK/src/alg_utils.jl new file mode 100644 index 0000000000..d809df6101 --- /dev/null +++ b/lib/OrdinaryDiffEqFIRK/src/alg_utils.jl @@ -0,0 +1,7 @@ +qmax_default(alg::Union{RadauIIA3, RadauIIA5}) = 8 + +alg_order(alg::RadauIIA3) = 3 +alg_order(alg::RadauIIA5) = 5 + +alg_adaptive_order(alg::RadauIIA3) = 1 +alg_adaptive_order(alg::RadauIIA5) = 3 \ No newline at end of file diff --git a/lib/OrdinaryDiffEqFIRK/src/algorithms.jl b/lib/OrdinaryDiffEqFIRK/src/algorithms.jl new file mode 100644 index 0000000000..c57945d9b0 --- /dev/null +++ b/lib/OrdinaryDiffEqFIRK/src/algorithms.jl @@ -0,0 +1,106 @@ +# FIRK Methods + +""" +@article{hairer1999stiff, +title={Stiff differential equations solved by Radau methods}, +author={Hairer, Ernst and Wanner, Gerhard}, +journal={Journal of Computational and Applied Mathematics}, +volume={111}, +number={1-2}, +pages={93--111}, +year={1999}, +publisher={Elsevier} +} + +RadauIIA3: Fully-Implicit Runge-Kutta Method +An A-B-L stable fully implicit Runge-Kutta method with internal tableau complex basis transform for efficiency. +""" +struct RadauIIA3{CS, AD, F, P, FDT, ST, CJ, Tol, C1, C2, StepLimiter} <: + OrdinaryDiffEqNewtonAdaptiveAlgorithm{CS, AD, FDT, ST, CJ} + linsolve::F + precs::P + extrapolant::Symbol + κ::Tol + maxiters::Int + fast_convergence_cutoff::C1 + new_W_γdt_cutoff::C2 + controller::Symbol + step_limiter!::StepLimiter +end + +function RadauIIA3(; chunk_size = Val{0}(), autodiff = Val{true}(), + standardtag = Val{true}(), concrete_jac = nothing, + diff_type = Val{:forward}, + linsolve = nothing, precs = DEFAULT_PRECS, + extrapolant = :dense, fast_convergence_cutoff = 1 // 5, + new_W_γdt_cutoff = 1 // 5, + controller = :Predictive, κ = nothing, maxiters = 10, + step_limiter! = trivial_limiter!) + RadauIIA3{_unwrap_val(chunk_size), _unwrap_val(autodiff), typeof(linsolve), + typeof(precs), diff_type, _unwrap_val(standardtag), _unwrap_val(concrete_jac), + typeof(κ), typeof(fast_convergence_cutoff), + typeof(new_W_γdt_cutoff), typeof(step_limiter!)}(linsolve, + precs, + extrapolant, + κ, + maxiters, + fast_convergence_cutoff, + new_W_γdt_cutoff, + controller, + step_limiter!) +end + +TruncatedStacktraces.@truncate_stacktrace RadauIIA3 + +""" +@article{hairer1999stiff, +title={Stiff differential equations solved by Radau methods}, +author={Hairer, Ernst and Wanner, Gerhard}, +journal={Journal of Computational and Applied Mathematics}, +volume={111}, +number={1-2}, +pages={93--111}, +year={1999}, +publisher={Elsevier} +} + +RadauIIA5: Fully-Implicit Runge-Kutta Method +An A-B-L stable fully implicit Runge-Kutta method with internal tableau complex basis transform for efficiency. +""" +struct RadauIIA5{CS, AD, F, P, FDT, ST, CJ, Tol, C1, C2, StepLimiter} <: + OrdinaryDiffEqNewtonAdaptiveAlgorithm{CS, AD, FDT, ST, CJ} + linsolve::F + precs::P + smooth_est::Bool + extrapolant::Symbol + κ::Tol + maxiters::Int + fast_convergence_cutoff::C1 + new_W_γdt_cutoff::C2 + controller::Symbol + step_limiter!::StepLimiter +end + +function RadauIIA5(; chunk_size = Val{0}(), autodiff = Val{true}(), + standardtag = Val{true}(), concrete_jac = nothing, + diff_type = Val{:forward}, + linsolve = nothing, precs = DEFAULT_PRECS, + extrapolant = :dense, fast_convergence_cutoff = 1 // 5, + new_W_γdt_cutoff = 1 // 5, + controller = :Predictive, κ = nothing, maxiters = 10, smooth_est = true, + step_limiter! = trivial_limiter!) + RadauIIA5{_unwrap_val(chunk_size), _unwrap_val(autodiff), typeof(linsolve), + typeof(precs), diff_type, _unwrap_val(standardtag), _unwrap_val(concrete_jac), + typeof(κ), typeof(fast_convergence_cutoff), + typeof(new_W_γdt_cutoff), typeof(step_limiter!)}(linsolve, + precs, + smooth_est, + extrapolant, + κ, + maxiters, + fast_convergence_cutoff, + new_W_γdt_cutoff, + controller, + step_limiter!) +end +TruncatedStacktraces.@truncate_stacktrace RadauIIA5 \ No newline at end of file diff --git a/lib/OrdinaryDiffEqFIRK/src/controllers.jl b/lib/OrdinaryDiffEqFIRK/src/controllers.jl new file mode 100644 index 0000000000..93eb9ca9bc --- /dev/null +++ b/lib/OrdinaryDiffEqFIRK/src/controllers.jl @@ -0,0 +1,54 @@ +struct PredictiveController <: AbstractController +end + +@inline function stepsize_controller!(integrator, controller::PredictiveController, alg) + @unpack qmin, qmax, gamma = integrator.opts + EEst = DiffEqBase.value(integrator.EEst) + + if iszero(EEst) + q = inv(qmax) + else + if fac_default_gamma(alg) + fac = gamma + else + if alg isa Union{RadauIIA3, RadauIIA5} + @unpack iter = integrator.cache + @unpack maxiters = alg + else + @unpack iter, maxiters = integrator.cache.nlsolver + end + fac = min(gamma, (1 + 2 * maxiters) * gamma / (iter + 2 * maxiters)) + end + expo = 1 / (get_current_adaptive_order(alg, integrator.cache) + 1) + qtmp = DiffEqBase.fastpow(EEst, expo) / fac + @fastmath q = DiffEqBase.value(max(inv(qmax), min(inv(qmin), qtmp))) + integrator.qold = q + end + q +end + +function step_accept_controller!(integrator, controller::PredictiveController, alg, q) + @unpack qmin, qmax, gamma, qsteady_min, qsteady_max = integrator.opts + EEst = DiffEqBase.value(integrator.EEst) + + if integrator.success_iter > 0 + expo = 1 / (get_current_adaptive_order(alg, integrator.cache) + 1) + qgus = (integrator.dtacc / integrator.dt) * + DiffEqBase.fastpow((EEst^2) / integrator.erracc, expo) + qgus = max(inv(qmax), min(inv(qmin), qgus / gamma)) + qacc = max(q, qgus) + else + qacc = q + end + if qsteady_min <= qacc <= qsteady_max + qacc = one(qacc) + end + integrator.dtacc = integrator.dt + integrator.erracc = max(1e-2, EEst) + return integrator.dt / qacc +end + +function step_reject_controller!(integrator, controller::PredictiveController, alg) + @unpack dt, success_iter, qold = integrator + integrator.dt = success_iter == 0 ? 0.1 * dt : dt / qold +end \ No newline at end of file diff --git a/src/caches/firk_caches.jl b/lib/OrdinaryDiffEqFIRK/src/firk_caches.jl similarity index 100% rename from src/caches/firk_caches.jl rename to lib/OrdinaryDiffEqFIRK/src/firk_caches.jl diff --git a/src/perform_step/firk_perform_step.jl b/lib/OrdinaryDiffEqFIRK/src/firk_perform_step.jl similarity index 100% rename from src/perform_step/firk_perform_step.jl rename to lib/OrdinaryDiffEqFIRK/src/firk_perform_step.jl diff --git a/src/tableaus/firk_tableaus.jl b/lib/OrdinaryDiffEqFIRK/src/firk_tableaus.jl similarity index 100% rename from src/tableaus/firk_tableaus.jl rename to lib/OrdinaryDiffEqFIRK/src/firk_tableaus.jl diff --git a/lib/OrdinaryDiffEqFIRK/src/integrator_interface.jl b/lib/OrdinaryDiffEqFIRK/src/integrator_interface.jl new file mode 100644 index 0000000000..ced31522bf --- /dev/null +++ b/lib/OrdinaryDiffEqFIRK/src/integrator_interface.jl @@ -0,0 +1,4 @@ +@inline function DiffEqBase.get_tmp_cache(integrator, alg::Union{RadauIIA3, RadauIIA5}, + cache::OrdinaryDiffEqMutableCache) + (cache.tmp, cache.atmp) +end \ No newline at end of file diff --git a/test/algconvergence/ode_firk_tests.jl b/lib/OrdinaryDiffEqFIRK/test/ode_firk_tests.jl similarity index 99% rename from test/algconvergence/ode_firk_tests.jl rename to lib/OrdinaryDiffEqFIRK/test/ode_firk_tests.jl index 3672e30fa9..a7003ce88a 100644 --- a/test/algconvergence/ode_firk_tests.jl +++ b/lib/OrdinaryDiffEqFIRK/test/ode_firk_tests.jl @@ -57,4 +57,4 @@ for iip in (true, false) @test sol.stats.njacs < sol.stats.nw # W reuse end @test length(sol) < 5000 # the error estimate is not very good -end +end \ No newline at end of file diff --git a/lib/OrdinaryDiffEqFIRK/test/runtests.jl b/lib/OrdinaryDiffEqFIRK/test/runtests.jl new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/OrdinaryDiffEq.jl b/src/OrdinaryDiffEq.jl index 6214e87808..ed391eec82 100644 --- a/src/OrdinaryDiffEq.jl +++ b/src/OrdinaryDiffEq.jl @@ -148,7 +148,6 @@ include("generic_rosenbrock.jl") include("caches/basic_caches.jl") include("caches/low_order_rk_caches.jl") include("caches/high_order_rk_caches.jl") -include("caches/firk_caches.jl") include("caches/linear_caches.jl") include("caches/linear_nonlinear_caches.jl") include("caches/rosenbrock_caches.jl") @@ -162,7 +161,6 @@ include("caches/qprk_caches.jl") include("tableaus/low_order_rk_tableaus.jl") include("tableaus/high_order_rk_tableaus.jl") include("tableaus/rosenbrock_tableaus.jl") -include("tableaus/firk_tableaus.jl") include("tableaus/qprk_tableaus.jl") include("integrators/type.jl") @@ -181,7 +179,6 @@ include("perform_step/exponential_rk_perform_step.jl") include("perform_step/explicit_rk_perform_step.jl") include("perform_step/low_order_rk_perform_step.jl") include("perform_step/high_order_rk_perform_step.jl") -include("perform_step/firk_perform_step.jl") include("perform_step/rosenbrock_perform_step.jl") include("perform_step/composite_perform_step.jl") include("perform_step/adams_bashforth_moulton_perform_step.jl") @@ -275,22 +272,10 @@ export ImplicitEuler, ImplicitMidpoint, Trapezoid, TRBDF2, SDIRK2, SDIRK22, SFSDIRK4, SFSDIRK5, CFNLIRK3, SFSDIRK6, SFSDIRK7, SFSDIRK8, ESDIRK436L2SA2, ESDIRK437L2SA, ESDIRK547L2SA2, ESDIRK659L2SA -include("../lib/OrdinaryDiffEqBDF/src/OrdinaryDiffEqBDF.jl") -using ..OrdinaryDiffEqBDF -export ABDF2, QNDF1, QBDF1, QNDF2, QBDF2, QNDF, QBDF, FBDF, - SBDF2, SBDF3, SBDF4, MEBDF2, IMEXEuler, IMEXEulerARK - -include("../lib/OrdinaryDiffEqDefault/src/OrdinaryDiffEqDefault.jl") -using ..OrdinaryDiffEqDefault -export DefaultODEAlgorithm - -using ..OrdinaryDiffEqBDF: reinitFBDF!, error_constant, estimate_terk!, - calc_Lagrange_interp!, - calc_finite_difference_weights, estimate_terk, - calc_Lagrange_interp, - bdf_step_reject_controller! -include("nlsolve/newton.jl") -include("perform_step/dae_perform_step.jl") +export RadauIIA3, RadauIIA5, RadauIIA7 +include("../lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl") +using ..OrdinaryDiffEqFIRK +export RadauIIA3, RadauIIA5, RadauIIA7 import PrecompileTools @@ -428,8 +413,6 @@ export FunctionMap, Euler, Heun, Ralston, Midpoint, RK4, ExplicitRK, OwrenZen3, FRK65, PFRK87, RKM, MSRK5, MSRK6, Stepanov5, SIR54, QPRK98, PSRK4p7q6, PSRK3p6q5, PSRK3p5q4 -export RadauIIA3, RadauIIA5, RadauIIA7 - export MagnusMidpoint, LinearExponential, MagnusLeapfrog, LieEuler, CayleyEuler, MagnusGauss4, MagnusNC6, MagnusGL6, MagnusGL8, MagnusNC8, MagnusGL4, MagnusAdapt4, RKMK2, RKMK4, LieRK4, CG2, CG3, CG4a diff --git a/src/alg_utils.jl b/src/alg_utils.jl index 77bf1df0f4..83f9d54167 100644 --- a/src/alg_utils.jl +++ b/src/alg_utils.jl @@ -528,9 +528,6 @@ alg_adaptive_order(alg::Union{OrdinaryDiffEqAlgorithm, DAEAlgorithm}) = alg_orde alg_adaptive_order(alg::Rosenbrock23) = 3 alg_adaptive_order(alg::Rosenbrock32) = 2 -alg_adaptive_order(alg::RadauIIA3) = 1 -alg_adaptive_order(alg::RadauIIA5) = 3 - # this is actually incorrect and is purposefully decreased as this tends # to track the real error much better # this is actually incorrect and is purposefully decreased as this tends diff --git a/src/integrators/controllers.jl b/src/integrators/controllers.jl index 69169566c3..20ff5e643a 100644 --- a/src/integrators/controllers.jl +++ b/src/integrators/controllers.jl @@ -393,60 +393,6 @@ else end ``` """ -struct PredictiveController <: AbstractController -end - -@inline function stepsize_controller!(integrator, controller::PredictiveController, alg) - @unpack qmin, qmax, gamma = integrator.opts - EEst = DiffEqBase.value(integrator.EEst) - - if iszero(EEst) - q = inv(qmax) - else - if fac_default_gamma(alg) - fac = gamma - else - if alg isa Union{RadauIIA3, RadauIIA5, RadauIIA7} - @unpack iter = integrator.cache - @unpack maxiters = alg - else - @unpack iter, maxiters = integrator.cache.nlsolver - end - fac = min(gamma, (1 + 2 * maxiters) * gamma / (iter + 2 * maxiters)) - end - expo = 1 / (get_current_adaptive_order(alg, integrator.cache) + 1) - qtmp = DiffEqBase.fastpow(EEst, expo) / fac - @fastmath q = DiffEqBase.value(max(inv(qmax), min(inv(qmin), qtmp))) - integrator.qold = q - end - q -end - -function step_accept_controller!(integrator, controller::PredictiveController, alg, q) - @unpack qmin, qmax, gamma, qsteady_min, qsteady_max = integrator.opts - EEst = DiffEqBase.value(integrator.EEst) - - if integrator.success_iter > 0 - expo = 1 / (get_current_adaptive_order(alg, integrator.cache) + 1) - qgus = (integrator.dtacc / integrator.dt) * - DiffEqBase.fastpow((EEst^2) / integrator.erracc, expo) - qgus = max(inv(qmax), min(inv(qmin), qgus / gamma)) - qacc = max(q, qgus) - else - qacc = q - end - if qsteady_min <= qacc <= qsteady_max - qacc = one(qacc) - end - integrator.dtacc = integrator.dt - integrator.erracc = max(1e-2, EEst) - return integrator.dt / qacc -end - -function step_reject_controller!(integrator, controller::PredictiveController, alg) - @unpack dt, success_iter, qold = integrator - integrator.dt = success_iter == 0 ? 0.1 * dt : dt / qold -end # Dummy controller without any method implementations. # This is used to transfer the special controllers associated to certain diff --git a/src/integrators/integrator_interface.jl b/src/integrators/integrator_interface.jl index 58624905ac..571841f981 100644 --- a/src/integrators/integrator_interface.jl +++ b/src/integrators/integrator_interface.jl @@ -125,11 +125,6 @@ end cache::OrdinaryDiffEqMutableCache) (cache.tmp,) end -@inline function DiffEqBase.get_tmp_cache( - integrator, alg::Union{RadauIIA3, RadauIIA5, RadauIIA7}, - cache::OrdinaryDiffEqMutableCache) - (cache.tmp, cache.atmp) -end @inline function DiffEqBase.get_tmp_cache(integrator, alg::OrdinaryDiffEqNewtonAdaptiveAlgorithm, cache::OrdinaryDiffEqMutableCache) diff --git a/test/runtests.jl b/test/runtests.jl index 2bce643dd9..3327354672 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -77,6 +77,12 @@ function activate_sdirk() Pkg.instantiate() end +function activate_firk() + Pkg.activate("../lib/OrdinaryDiffEqFIRK") + Pkg.develop(PackageSpec(path = dirname(@__DIR__))) + Pkg.instantiate() +end + #Start Test Script @time begin @@ -208,12 +214,15 @@ end @time @safetestset "Linear Methods Tests" include("algconvergence/linear_method_tests.jl") @time @safetestset "Split Methods Tests" include("algconvergence/split_methods_tests.jl") @time @safetestset "Rosenbrock Tests" include("algconvergence/ode_rosenbrock_tests.jl") - @time @safetestset "FIRK Tests" include("algconvergence/ode_firk_tests.jl") @time @safetestset "Linear-Nonlinear Methods Tests" include("algconvergence/linear_nonlinear_convergence_tests.jl") @time @safetestset "Linear-Nonlinear Krylov Methods Tests" include("algconvergence/linear_nonlinear_krylov_tests.jl") @time @safetestset "Quadruple precision Runge-Kutta Tests" include("algconvergence/ode_quadruple_precision_tests.jl") end + if !is_APPVEYOR && GROUP == "FIRK" + @time @safetestset "FIRK Tests" include("../lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl") + end + if !is_APPVEYOR && GROUP == "Symplectic" @time @safetestset "Symplectic Tests" include("../lib/OrdinaryDiffEqSymplecticRK/test/symplectic_tests.jl") end From dfb2480250ab274bb5a4311e55bc873b450e9694 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Tue, 16 Jul 2024 11:22:38 +0530 Subject: [PATCH 02/47] Changes --- .../test/runtests.jl | 2 +- lib/OrdinaryDiffEqFIRK/Project.toml | 17 ++++++++++++++++- lib/OrdinaryDiffEqFIRK/test/runtests.jl | 3 +++ lib/OrdinaryDiffEqFeagin/test/runtests.jl | 3 +++ 4 files changed, 23 insertions(+), 2 deletions(-) diff --git a/lib/OrdinaryDiffEqExtrapolation/test/runtests.jl b/lib/OrdinaryDiffEqExtrapolation/test/runtests.jl index 738c8013cc..4aee75dc86 100644 --- a/lib/OrdinaryDiffEqExtrapolation/test/runtests.jl +++ b/lib/OrdinaryDiffEqExtrapolation/test/runtests.jl @@ -1,3 +1,3 @@ using SafeTestsets -@time @safetestset "Extrapolation Tests" include("ode_extrapolation_tests.jl") +@time @safetestset "Extrapolation Tests" include("ode_extrapolation_tests.jl") \ No newline at end of file diff --git a/lib/OrdinaryDiffEqFIRK/Project.toml b/lib/OrdinaryDiffEqFIRK/Project.toml index f6e415fb8f..73ee220584 100644 --- a/lib/OrdinaryDiffEqFIRK/Project.toml +++ b/lib/OrdinaryDiffEqFIRK/Project.toml @@ -1,4 +1,19 @@ name = "OrdinaryDiffEqFIRK" uuid = "5960d6e9-dd7a-4743-88e7-cf307b64f125" authors = ["ParamThakkar123 "] -version = "0.1.0" +version = "1.0.0" + +[deps] +OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" + +[compat] +julia = "1.10" + +[extras] +DiffEqDevTools = "f3b72e0c-5b89-59e1-b016-84e28bfd966d" +Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" +SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" + +[targets] +test = ["DiffEqDevTools", "Random", "SafeTestsets", "Test"] \ No newline at end of file diff --git a/lib/OrdinaryDiffEqFIRK/test/runtests.jl b/lib/OrdinaryDiffEqFIRK/test/runtests.jl index e69de29bb2..b252cdf8f2 100644 --- a/lib/OrdinaryDiffEqFIRK/test/runtests.jl +++ b/lib/OrdinaryDiffEqFIRK/test/runtests.jl @@ -0,0 +1,3 @@ +using SafeTestsets + +@time @safetestset "FIRK Tests" include("ode_firk_tests.jl") \ No newline at end of file diff --git a/lib/OrdinaryDiffEqFeagin/test/runtests.jl b/lib/OrdinaryDiffEqFeagin/test/runtests.jl index 8b13789179..e24bef2c88 100644 --- a/lib/OrdinaryDiffEqFeagin/test/runtests.jl +++ b/lib/OrdinaryDiffEqFeagin/test/runtests.jl @@ -1 +1,4 @@ +using SafeTestsets + +@time @safetestset "Feagin Tests" include("ode_feagin_tests.jl") \ No newline at end of file From 4ef9cc3881d54ee0630e43baa10ffc4c46de121a Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sat, 20 Jul 2024 18:52:31 -0400 Subject: [PATCH 03/47] add IIA7 --- lib/OrdinaryDiffEqFIRK/src/alg_utils.jl | 6 ++++-- lib/OrdinaryDiffEqFIRK/src/controllers.jl | 4 ++-- lib/OrdinaryDiffEqFIRK/src/integrator_interface.jl | 4 ++-- src/alg_utils.jl | 4 ---- 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/lib/OrdinaryDiffEqFIRK/src/alg_utils.jl b/lib/OrdinaryDiffEqFIRK/src/alg_utils.jl index d809df6101..22fbb7a34f 100644 --- a/lib/OrdinaryDiffEqFIRK/src/alg_utils.jl +++ b/lib/OrdinaryDiffEqFIRK/src/alg_utils.jl @@ -1,7 +1,9 @@ -qmax_default(alg::Union{RadauIIA3, RadauIIA5}) = 8 +qmax_default(alg::Union{RadauIIA3, RadauIIA5, RadauIIA7}) = 8 alg_order(alg::RadauIIA3) = 3 alg_order(alg::RadauIIA5) = 5 +alg_order(alg::RadauIIA7) = 7 alg_adaptive_order(alg::RadauIIA3) = 1 -alg_adaptive_order(alg::RadauIIA5) = 3 \ No newline at end of file +alg_adaptive_order(alg::RadauIIA5) = 3 +alg_adaptive_order(alg::RadauIIA7) = 5 diff --git a/lib/OrdinaryDiffEqFIRK/src/controllers.jl b/lib/OrdinaryDiffEqFIRK/src/controllers.jl index 93eb9ca9bc..33e87c3e29 100644 --- a/lib/OrdinaryDiffEqFIRK/src/controllers.jl +++ b/lib/OrdinaryDiffEqFIRK/src/controllers.jl @@ -11,7 +11,7 @@ end if fac_default_gamma(alg) fac = gamma else - if alg isa Union{RadauIIA3, RadauIIA5} + if alg isa Union{RadauIIA3, RadauIIA5, RadauIIA7} @unpack iter = integrator.cache @unpack maxiters = alg else @@ -51,4 +51,4 @@ end function step_reject_controller!(integrator, controller::PredictiveController, alg) @unpack dt, success_iter, qold = integrator integrator.dt = success_iter == 0 ? 0.1 * dt : dt / qold -end \ No newline at end of file +end diff --git a/lib/OrdinaryDiffEqFIRK/src/integrator_interface.jl b/lib/OrdinaryDiffEqFIRK/src/integrator_interface.jl index ced31522bf..5266edfdc8 100644 --- a/lib/OrdinaryDiffEqFIRK/src/integrator_interface.jl +++ b/lib/OrdinaryDiffEqFIRK/src/integrator_interface.jl @@ -1,4 +1,4 @@ -@inline function DiffEqBase.get_tmp_cache(integrator, alg::Union{RadauIIA3, RadauIIA5}, +@inline function DiffEqBase.get_tmp_cache(integrator, alg::Union{RadauIIA3, RadauIIA5, RadauIIA7}, cache::OrdinaryDiffEqMutableCache) (cache.tmp, cache.atmp) -end \ No newline at end of file +end diff --git a/src/alg_utils.jl b/src/alg_utils.jl index 83f9d54167..3bbe671a75 100644 --- a/src/alg_utils.jl +++ b/src/alg_utils.jl @@ -175,7 +175,6 @@ qmin_default(alg::DP8) = 1 // 3 qmax_default(alg::Union{OrdinaryDiffEqAlgorithm, DAEAlgorithm}) = 10 qmax_default(alg::CompositeAlgorithm) = minimum(qmax_default.(alg.algs)) qmax_default(alg::DP8) = 6 -qmax_default(alg::Union{RadauIIA3, RadauIIA5, RadauIIA7}) = 8 function has_chunksize(alg::OrdinaryDiffEqAlgorithm) return alg isa Union{OrdinaryDiffEqExponentialAlgorithm, @@ -428,9 +427,6 @@ alg_order(alg::Tsit5) = 5 alg_order(alg::DP8) = 8 alg_order(alg::TanYam7) = 7 alg_order(alg::TsitPap8) = 8 -alg_order(alg::RadauIIA3) = 3 -alg_order(alg::RadauIIA5) = 5 -alg_order(alg::RadauIIA7) = 7 alg_order(alg::RKMK2) = 2 alg_order(alg::RKMK4) = 4 alg_order(alg::LieRK4) = 4 From 82afb968e9a99ce729690782d8fb24d72c55545d Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sat, 20 Jul 2024 19:04:08 -0400 Subject: [PATCH 04/47] Update lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl --- lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl index 71b5a2d056..e2f8f33586 100644 --- a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl +++ b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl @@ -3,7 +3,7 @@ module OrdinaryDiffEqFIRK import OrdinaryDiffEq: alg_order, calculate_residuals!, initialize!, perform_step!, @unpack, unwrap_alg, calculate_residuals, - OrdinaryDiffEqAlgorithm, + OrdinaryDiffEqAlgorithm, OrdinaryDiffEqNewtonAdaptiveAlgorithm, OrdinaryDiffEqMutableCache, OrdinaryDiffEqConstantCache, OrdinaryDiffEqAdaptiveAlgorithm, CompiledFloats, uses_uprev, alg_cache, _vec, _reshape, @cache, isfsal, full_cache, From 97e993706761ab0f2f54bd2dc8d0276208b0a330 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sat, 20 Jul 2024 19:10:49 -0400 Subject: [PATCH 05/47] Remove truncatedstacktraces --- lib/OrdinaryDiffEqFIRK/src/algorithms.jl | 3 --- lib/OrdinaryDiffEqFIRK/src/firk_caches.jl | 2 -- 2 files changed, 5 deletions(-) diff --git a/lib/OrdinaryDiffEqFIRK/src/algorithms.jl b/lib/OrdinaryDiffEqFIRK/src/algorithms.jl index c57945d9b0..fc965d64c6 100644 --- a/lib/OrdinaryDiffEqFIRK/src/algorithms.jl +++ b/lib/OrdinaryDiffEqFIRK/src/algorithms.jl @@ -50,8 +50,6 @@ function RadauIIA3(; chunk_size = Val{0}(), autodiff = Val{true}(), step_limiter!) end -TruncatedStacktraces.@truncate_stacktrace RadauIIA3 - """ @article{hairer1999stiff, title={Stiff differential equations solved by Radau methods}, @@ -103,4 +101,3 @@ function RadauIIA5(; chunk_size = Val{0}(), autodiff = Val{true}(), controller, step_limiter!) end -TruncatedStacktraces.@truncate_stacktrace RadauIIA5 \ No newline at end of file diff --git a/lib/OrdinaryDiffEqFIRK/src/firk_caches.jl b/lib/OrdinaryDiffEqFIRK/src/firk_caches.jl index fb1489270b..5a560d2ae4 100644 --- a/lib/OrdinaryDiffEqFIRK/src/firk_caches.jl +++ b/lib/OrdinaryDiffEqFIRK/src/firk_caches.jl @@ -200,7 +200,6 @@ mutable struct RadauIIA5Cache{uType, cuType, uNoUnitsType, rateType, JType, W1Ty status::NLStatus step_limiter!::StepLimiter end -TruncatedStacktraces.@truncate_stacktrace RadauIIA5Cache 1 function alg_cache(alg::RadauIIA5, u, rate_prototype, ::Type{uEltypeNoUnits}, ::Type{uBottomEltypeNoUnits}, @@ -370,7 +369,6 @@ mutable struct RadauIIA7Cache{uType, cuType, uNoUnitsType, rateType, JType, W1Ty status::NLStatus step_limiter!::StepLimiter end -TruncatedStacktraces.@truncate_stacktrace RadauIIA7Cache 1 function alg_cache(alg::RadauIIA7, u, rate_prototype, ::Type{uEltypeNoUnits}, ::Type{uBottomEltypeNoUnits}, From ab91334dfaa2e5dfa82ff79c05325d483f157bf4 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sat, 20 Jul 2024 19:36:34 -0400 Subject: [PATCH 06/47] Update algorithms.jl --- src/algorithms.jl | 162 ---------------------------------------------- 1 file changed, 162 deletions(-) diff --git a/src/algorithms.jl b/src/algorithms.jl index 1b921906bb..238926aa4c 100644 --- a/src/algorithms.jl +++ b/src/algorithms.jl @@ -554,168 +554,6 @@ struct CayleyEuler <: OrdinaryDiffEqAlgorithm end ################################################################################ -# FIRK Methods - -""" -@article{hairer1999stiff, -title={Stiff differential equations solved by Radau methods}, -author={Hairer, Ernst and Wanner, Gerhard}, -journal={Journal of Computational and Applied Mathematics}, -volume={111}, -number={1-2}, -pages={93--111}, -year={1999}, -publisher={Elsevier} -} - -RadauIIA3: Fully-Implicit Runge-Kutta Method -An A-B-L stable fully implicit Runge-Kutta method with internal tableau complex basis transform for efficiency. -""" -struct RadauIIA3{CS, AD, F, P, FDT, ST, CJ, Tol, C1, C2, StepLimiter} <: - OrdinaryDiffEqNewtonAdaptiveAlgorithm{CS, AD, FDT, ST, CJ} - linsolve::F - precs::P - extrapolant::Symbol - κ::Tol - maxiters::Int - fast_convergence_cutoff::C1 - new_W_γdt_cutoff::C2 - controller::Symbol - step_limiter!::StepLimiter -end - -function RadauIIA3(; chunk_size = Val{0}(), autodiff = Val{true}(), - standardtag = Val{true}(), concrete_jac = nothing, - diff_type = Val{:forward}, - linsolve = nothing, precs = DEFAULT_PRECS, - extrapolant = :dense, fast_convergence_cutoff = 1 // 5, - new_W_γdt_cutoff = 1 // 5, - controller = :Predictive, κ = nothing, maxiters = 10, - step_limiter! = trivial_limiter!) - RadauIIA3{_unwrap_val(chunk_size), _unwrap_val(autodiff), typeof(linsolve), - typeof(precs), diff_type, _unwrap_val(standardtag), _unwrap_val(concrete_jac), - typeof(κ), typeof(fast_convergence_cutoff), - typeof(new_W_γdt_cutoff), typeof(step_limiter!)}(linsolve, - precs, - extrapolant, - κ, - maxiters, - fast_convergence_cutoff, - new_W_γdt_cutoff, - controller, - step_limiter!) -end - -TruncatedStacktraces.@truncate_stacktrace RadauIIA3 - -""" -@article{hairer1999stiff, -title={Stiff differential equations solved by Radau methods}, -author={Hairer, Ernst and Wanner, Gerhard}, -journal={Journal of Computational and Applied Mathematics}, -volume={111}, -number={1-2}, -pages={93--111}, -year={1999}, -publisher={Elsevier} -} - -RadauIIA5: Fully-Implicit Runge-Kutta Method -An A-B-L stable fully implicit Runge-Kutta method with internal tableau complex basis transform for efficiency. -""" -struct RadauIIA5{CS, AD, F, P, FDT, ST, CJ, Tol, C1, C2, StepLimiter} <: - OrdinaryDiffEqNewtonAdaptiveAlgorithm{CS, AD, FDT, ST, CJ} - linsolve::F - precs::P - smooth_est::Bool - extrapolant::Symbol - κ::Tol - maxiters::Int - fast_convergence_cutoff::C1 - new_W_γdt_cutoff::C2 - controller::Symbol - step_limiter!::StepLimiter -end - -function RadauIIA5(; chunk_size = Val{0}(), autodiff = Val{true}(), - standardtag = Val{true}(), concrete_jac = nothing, - diff_type = Val{:forward}, - linsolve = nothing, precs = DEFAULT_PRECS, - extrapolant = :dense, fast_convergence_cutoff = 1 // 5, - new_W_γdt_cutoff = 1 // 5, - controller = :Predictive, κ = nothing, maxiters = 10, smooth_est = true, - step_limiter! = trivial_limiter!) - RadauIIA5{_unwrap_val(chunk_size), _unwrap_val(autodiff), typeof(linsolve), - typeof(precs), diff_type, _unwrap_val(standardtag), _unwrap_val(concrete_jac), - typeof(κ), typeof(fast_convergence_cutoff), - typeof(new_W_γdt_cutoff), typeof(step_limiter!)}(linsolve, - precs, - smooth_est, - extrapolant, - κ, - maxiters, - fast_convergence_cutoff, - new_W_γdt_cutoff, - controller, - step_limiter!) -end -TruncatedStacktraces.@truncate_stacktrace RadauIIA5 - -""" -@article{hairer1999stiff, -title={Stiff differential equations solved by Radau methods}, -author={Hairer, Ernst and Wanner, Gerhard}, -journal={Journal of Computational and Applied Mathematics}, -volume={111}, -number={1-2}, -pages={93--111}, -year={1999}, -publisher={Elsevier} -} - -RadauIIA7: Fully-Implicit Runge-Kutta Method -An A-B-L stable fully implicit Runge-Kutta method with internal tableau complex basis transform for efficiency. -""" -struct RadauIIA7{CS, AD, F, P, FDT, ST, CJ, Tol, C1, C2, StepLimiter} <: - OrdinaryDiffEqNewtonAdaptiveAlgorithm{CS, AD, FDT, ST, CJ} - linsolve::F - precs::P - smooth_est::Bool - extrapolant::Symbol - κ::Tol - maxiters::Int - fast_convergence_cutoff::C1 - new_W_γdt_cutoff::C2 - controller::Symbol - step_limiter!::StepLimiter -end - -function RadauIIA7(; chunk_size = Val{0}(), autodiff = Val{true}(), - standardtag = Val{true}(), concrete_jac = nothing, - diff_type = Val{:forward}, - linsolve = nothing, precs = DEFAULT_PRECS, - extrapolant = :dense, fast_convergence_cutoff = 1 // 5, - new_W_γdt_cutoff = 1 // 5, - controller = :Predictive, κ = nothing, maxiters = 10, smooth_est = true, - step_limiter! = trivial_limiter!) - RadauIIA7{_unwrap_val(chunk_size), _unwrap_val(autodiff), typeof(linsolve), - typeof(precs), diff_type, _unwrap_val(standardtag), _unwrap_val(concrete_jac), - typeof(κ), typeof(fast_convergence_cutoff), - typeof(new_W_γdt_cutoff), typeof(step_limiter!)}(linsolve, - precs, - smooth_est, - extrapolant, - κ, - maxiters, - fast_convergence_cutoff, - new_W_γdt_cutoff, - controller, - step_limiter!) -end -TruncatedStacktraces.@truncate_stacktrace RadauIIA7 - -################################################################################ - ################################################################################ # Rosenbrock Methods From 1b80ad1e51956355b271d21c1d7e8542d9dca350 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sat, 20 Jul 2024 19:36:50 -0400 Subject: [PATCH 07/47] Update algorithms.jl --- lib/OrdinaryDiffEqFIRK/src/algorithms.jl | 52 ++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/lib/OrdinaryDiffEqFIRK/src/algorithms.jl b/lib/OrdinaryDiffEqFIRK/src/algorithms.jl index fc965d64c6..05953b9d58 100644 --- a/lib/OrdinaryDiffEqFIRK/src/algorithms.jl +++ b/lib/OrdinaryDiffEqFIRK/src/algorithms.jl @@ -101,3 +101,55 @@ function RadauIIA5(; chunk_size = Val{0}(), autodiff = Val{true}(), controller, step_limiter!) end + +""" +@article{hairer1999stiff, +title={Stiff differential equations solved by Radau methods}, +author={Hairer, Ernst and Wanner, Gerhard}, +journal={Journal of Computational and Applied Mathematics}, +volume={111}, +number={1-2}, +pages={93--111}, +year={1999}, +publisher={Elsevier} +} + +RadauIIA7: Fully-Implicit Runge-Kutta Method +An A-B-L stable fully implicit Runge-Kutta method with internal tableau complex basis transform for efficiency. +""" +struct RadauIIA7{CS, AD, F, P, FDT, ST, CJ, Tol, C1, C2, StepLimiter} <: + OrdinaryDiffEqNewtonAdaptiveAlgorithm{CS, AD, FDT, ST, CJ} + linsolve::F + precs::P + smooth_est::Bool + extrapolant::Symbol + κ::Tol + maxiters::Int + fast_convergence_cutoff::C1 + new_W_γdt_cutoff::C2 + controller::Symbol + step_limiter!::StepLimiter +end + +function RadauIIA7(; chunk_size = Val{0}(), autodiff = Val{true}(), + standardtag = Val{true}(), concrete_jac = nothing, + diff_type = Val{:forward}, + linsolve = nothing, precs = DEFAULT_PRECS, + extrapolant = :dense, fast_convergence_cutoff = 1 // 5, + new_W_γdt_cutoff = 1 // 5, + controller = :Predictive, κ = nothing, maxiters = 10, smooth_est = true, + step_limiter! = trivial_limiter!) + RadauIIA7{_unwrap_val(chunk_size), _unwrap_val(autodiff), typeof(linsolve), + typeof(precs), diff_type, _unwrap_val(standardtag), _unwrap_val(concrete_jac), + typeof(κ), typeof(fast_convergence_cutoff), + typeof(new_W_γdt_cutoff), typeof(step_limiter!)}(linsolve, + precs, + smooth_est, + extrapolant, + κ, + maxiters, + fast_convergence_cutoff, + new_W_γdt_cutoff, + controller, + step_limiter!) +end From 341679dee1017fc7ef56919bca11cc18ac6f323a Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sun, 21 Jul 2024 04:21:27 -0400 Subject: [PATCH 08/47] Update lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl --- lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl index e2f8f33586..1eea96802b 100644 --- a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl +++ b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl @@ -9,7 +9,7 @@ import OrdinaryDiffEq: alg_order, calculate_residuals!, alg_cache, _vec, _reshape, @cache, isfsal, full_cache, constvalue, _unwrap_val, du_alias_or_new, explicit_rk_docstring, trivial_limiter!, - _ode_interpolant!, _ode_addsteps! + _ode_interpolant!, _ode_addsteps!, AbstractController include("algorithms.jl") include("alg_utils.jl") From 74dc755264a75d66987a5e82042ddb140df72053 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sun, 21 Jul 2024 04:33:38 -0400 Subject: [PATCH 09/47] Update lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl --- lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl index 1eea96802b..d3bb4900d6 100644 --- a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl +++ b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl @@ -9,7 +9,8 @@ import OrdinaryDiffEq: alg_order, calculate_residuals!, alg_cache, _vec, _reshape, @cache, isfsal, full_cache, constvalue, _unwrap_val, du_alias_or_new, explicit_rk_docstring, trivial_limiter!, - _ode_interpolant!, _ode_addsteps!, AbstractController + _ode_interpolant!, _ode_addsteps!, AbstractController, + NLStatus include("algorithms.jl") include("alg_utils.jl") From 65410f2474724a80a5cec7e0465f6923f805bb0d Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sun, 21 Jul 2024 04:34:30 -0400 Subject: [PATCH 10/47] Update lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl --- lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl index d3bb4900d6..c568bb9de7 100644 --- a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl +++ b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl @@ -10,7 +10,7 @@ import OrdinaryDiffEq: alg_order, calculate_residuals!, constvalue, _unwrap_val, du_alias_or_new, explicit_rk_docstring, trivial_limiter!, _ode_interpolant!, _ode_addsteps!, AbstractController, - NLStatus + NLStatus, qmax_default, alg_adaptive_order include("algorithms.jl") include("alg_utils.jl") From e08b7131e4c3955df05c3d62ebf825f3deeb2495 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Sun, 21 Jul 2024 05:01:29 -0400 Subject: [PATCH 11/47] Update lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl --- lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl index c568bb9de7..0399554376 100644 --- a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl +++ b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl @@ -11,7 +11,7 @@ import OrdinaryDiffEq: alg_order, calculate_residuals!, explicit_rk_docstring, trivial_limiter!, _ode_interpolant!, _ode_addsteps!, AbstractController, NLStatus, qmax_default, alg_adaptive_order - +import FastBroadcast: @.. include("algorithms.jl") include("alg_utils.jl") include("controllers.jl") From 280f4bea2cbef403b765696f6350f2fc3f7a0ac6 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Sun, 21 Jul 2024 22:06:50 +0530 Subject: [PATCH 12/47] @muladd --- lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl index 0399554376..e4c6787396 100644 --- a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl +++ b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl @@ -11,6 +11,7 @@ import OrdinaryDiffEq: alg_order, calculate_residuals!, explicit_rk_docstring, trivial_limiter!, _ode_interpolant!, _ode_addsteps!, AbstractController, NLStatus, qmax_default, alg_adaptive_order +using MuladdMacro import FastBroadcast: @.. include("algorithms.jl") include("alg_utils.jl") From 91d0726baa82cfb5d053c9e539b7f5d53a664bf0 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Sun, 21 Jul 2024 22:10:33 +0530 Subject: [PATCH 13/47] DiffEqBase --- lib/OrdinaryDiffEqFIRK/Project.toml | 1 + lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqFIRK/Project.toml b/lib/OrdinaryDiffEqFIRK/Project.toml index 73ee220584..515a3a2b84 100644 --- a/lib/OrdinaryDiffEqFIRK/Project.toml +++ b/lib/OrdinaryDiffEqFIRK/Project.toml @@ -5,6 +5,7 @@ version = "1.0.0" [deps] OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" +DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e" [compat] julia = "1.10" diff --git a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl index e4c6787396..3daecf8e2b 100644 --- a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl +++ b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl @@ -11,7 +11,7 @@ import OrdinaryDiffEq: alg_order, calculate_residuals!, explicit_rk_docstring, trivial_limiter!, _ode_interpolant!, _ode_addsteps!, AbstractController, NLStatus, qmax_default, alg_adaptive_order -using MuladdMacro +using MuladdMacro, DiffEqBase import FastBroadcast: @.. include("algorithms.jl") include("alg_utils.jl") From 2c964e7af9082b2403f6d7af22e6e2b5cb8315e4 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Sun, 21 Jul 2024 22:19:17 +0530 Subject: [PATCH 14/47] FBDF --- src/OrdinaryDiffEq.jl | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/OrdinaryDiffEq.jl b/src/OrdinaryDiffEq.jl index ed391eec82..721b6a488a 100644 --- a/src/OrdinaryDiffEq.jl +++ b/src/OrdinaryDiffEq.jl @@ -272,11 +272,23 @@ export ImplicitEuler, ImplicitMidpoint, Trapezoid, TRBDF2, SDIRK2, SDIRK22, SFSDIRK4, SFSDIRK5, CFNLIRK3, SFSDIRK6, SFSDIRK7, SFSDIRK8, ESDIRK436L2SA2, ESDIRK437L2SA, ESDIRK547L2SA2, ESDIRK659L2SA -export RadauIIA3, RadauIIA5, RadauIIA7 +include("../lib/OrdinaryDiffEqBDF/src/OrdinaryDiffEqBDF.jl") +using ..OrdinaryDiffEqBDF +export ABDF2, QNDF1, QBDF1, QNDF2, QBDF2, QNDF, QBDF, FBDF, + SBDF2, SBDF3, SBDF4, MEBDF2, IMEXEuler, IMEXEulerARK + include("../lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl") using ..OrdinaryDiffEqFIRK export RadauIIA3, RadauIIA5, RadauIIA7 +using ..OrdinaryDiffEqBDF: reinitFBDF!, error_constant, estimate_terk!, + calc_Lagrange_interp!, + calc_finite_difference_weights, estimate_terk, + calc_Lagrange_interp, + bdf_step_reject_controller! +include("nlsolve/newton.jl") +include("perform_step/dae_perform_step.jl") + import PrecompileTools PrecompileTools.@compile_workload begin From 241dc41f8e853529256da5443de5a7e3dfab5551 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Sun, 21 Jul 2024 22:22:43 +0530 Subject: [PATCH 15/47] DefaultODEAlgorithm --- src/OrdinaryDiffEq.jl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/OrdinaryDiffEq.jl b/src/OrdinaryDiffEq.jl index 721b6a488a..f9c9866eb4 100644 --- a/src/OrdinaryDiffEq.jl +++ b/src/OrdinaryDiffEq.jl @@ -272,6 +272,10 @@ export ImplicitEuler, ImplicitMidpoint, Trapezoid, TRBDF2, SDIRK2, SDIRK22, SFSDIRK4, SFSDIRK5, CFNLIRK3, SFSDIRK6, SFSDIRK7, SFSDIRK8, ESDIRK436L2SA2, ESDIRK437L2SA, ESDIRK547L2SA2, ESDIRK659L2SA +include("../lib/OrdinaryDiffEqDefault/src/OrdinaryDiffEqDefault.jl") +using ..OrdinaryDiffEqDefault +export DefaultODEAlgorithm + include("../lib/OrdinaryDiffEqBDF/src/OrdinaryDiffEqBDF.jl") using ..OrdinaryDiffEqBDF export ABDF2, QNDF1, QBDF1, QNDF2, QBDF2, QNDF, QBDF, FBDF, From f7a4dc29bb496c4fbbbd5a39367471154d7903b8 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Sun, 21 Jul 2024 22:25:08 +0530 Subject: [PATCH 16/47] DefaultODEAlgorithm --- src/OrdinaryDiffEq.jl | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/OrdinaryDiffEq.jl b/src/OrdinaryDiffEq.jl index f9c9866eb4..b1c1984561 100644 --- a/src/OrdinaryDiffEq.jl +++ b/src/OrdinaryDiffEq.jl @@ -272,15 +272,15 @@ export ImplicitEuler, ImplicitMidpoint, Trapezoid, TRBDF2, SDIRK2, SDIRK22, SFSDIRK4, SFSDIRK5, CFNLIRK3, SFSDIRK6, SFSDIRK7, SFSDIRK8, ESDIRK436L2SA2, ESDIRK437L2SA, ESDIRK547L2SA2, ESDIRK659L2SA -include("../lib/OrdinaryDiffEqDefault/src/OrdinaryDiffEqDefault.jl") -using ..OrdinaryDiffEqDefault -export DefaultODEAlgorithm - include("../lib/OrdinaryDiffEqBDF/src/OrdinaryDiffEqBDF.jl") using ..OrdinaryDiffEqBDF export ABDF2, QNDF1, QBDF1, QNDF2, QBDF2, QNDF, QBDF, FBDF, SBDF2, SBDF3, SBDF4, MEBDF2, IMEXEuler, IMEXEulerARK +include("../lib/OrdinaryDiffEqDefault/src/OrdinaryDiffEqDefault.jl") +using ..OrdinaryDiffEqDefault +export DefaultODEAlgorithm + include("../lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl") using ..OrdinaryDiffEqFIRK export RadauIIA3, RadauIIA5, RadauIIA7 From 42b050cca3506a7eba09e8a55f344601542d59e6 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Sun, 21 Jul 2024 22:38:08 +0530 Subject: [PATCH 17/47] PredictiveController --- src/integrators/controllers.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/integrators/controllers.jl b/src/integrators/controllers.jl index 20ff5e643a..63900cb5fe 100644 --- a/src/integrators/controllers.jl +++ b/src/integrators/controllers.jl @@ -1,6 +1,9 @@ abstract type AbstractController end using OrdinaryDiffEq +struct PredictiveController <: AbstractController +end + @inline function stepsize_controller!(integrator, alg) stepsize_controller!(integrator, integrator.opts.controller, alg) end From 7dd801e8343fd3bbf5f61325263051695960823b Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Sun, 21 Jul 2024 22:56:15 +0530 Subject: [PATCH 18/47] PredictiveController --- src/OrdinaryDiffEq.jl | 1 + 1 file changed, 1 insertion(+) diff --git a/src/OrdinaryDiffEq.jl b/src/OrdinaryDiffEq.jl index b1c1984561..362e21ff58 100644 --- a/src/OrdinaryDiffEq.jl +++ b/src/OrdinaryDiffEq.jl @@ -290,6 +290,7 @@ using ..OrdinaryDiffEqBDF: reinitFBDF!, error_constant, estimate_terk!, calc_finite_difference_weights, estimate_terk, calc_Lagrange_interp, bdf_step_reject_controller! + include("nlsolve/newton.jl") include("perform_step/dae_perform_step.jl") From cb629758d14eeca5d366b12176a8cf4773937d61 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Sun, 21 Jul 2024 23:37:53 +0530 Subject: [PATCH 19/47] DEFAULT_PRECS --- lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl index 3daecf8e2b..d425e712a7 100644 --- a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl +++ b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl @@ -10,7 +10,7 @@ import OrdinaryDiffEq: alg_order, calculate_residuals!, constvalue, _unwrap_val, du_alias_or_new, explicit_rk_docstring, trivial_limiter!, _ode_interpolant!, _ode_addsteps!, AbstractController, - NLStatus, qmax_default, alg_adaptive_order + NLStatus, qmax_default, alg_adaptive_order, DEFAULT_PRECS using MuladdMacro, DiffEqBase import FastBroadcast: @.. include("algorithms.jl") From c4e2d3f1994660a7dfae0df92eafbdf879a147c2 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Sun, 21 Jul 2024 23:54:56 +0530 Subject: [PATCH 20/47] UJacobianWrapper --- lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl index d425e712a7..c1e5166003 100644 --- a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl +++ b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl @@ -10,7 +10,8 @@ import OrdinaryDiffEq: alg_order, calculate_residuals!, constvalue, _unwrap_val, du_alias_or_new, explicit_rk_docstring, trivial_limiter!, _ode_interpolant!, _ode_addsteps!, AbstractController, - NLStatus, qmax_default, alg_adaptive_order, DEFAULT_PRECS + NLStatus, qmax_default, alg_adaptive_order, DEFAULT_PRECS, + UJacobianWrapper using MuladdMacro, DiffEqBase import FastBroadcast: @.. include("algorithms.jl") From fe057a5939294bdebe3db87ab5fe6ec2c6aa8dd1 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 22 Jul 2024 00:11:08 +0530 Subject: [PATCH 21/47] RecursiveArrayTools --- lib/OrdinaryDiffEqFIRK/Project.toml | 1 + lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqFIRK/Project.toml b/lib/OrdinaryDiffEqFIRK/Project.toml index 515a3a2b84..d890526dc1 100644 --- a/lib/OrdinaryDiffEqFIRK/Project.toml +++ b/lib/OrdinaryDiffEqFIRK/Project.toml @@ -6,6 +6,7 @@ version = "1.0.0" [deps] OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e" +RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd" [compat] julia = "1.10" diff --git a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl index c1e5166003..be4fa3e209 100644 --- a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl +++ b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl @@ -12,7 +12,7 @@ import OrdinaryDiffEq: alg_order, calculate_residuals!, _ode_interpolant!, _ode_addsteps!, AbstractController, NLStatus, qmax_default, alg_adaptive_order, DEFAULT_PRECS, UJacobianWrapper -using MuladdMacro, DiffEqBase +using MuladdMacro, DiffEqBase, RecursiveArrayTools import FastBroadcast: @.. include("algorithms.jl") include("alg_utils.jl") From 20e8d6cb85bce9c48d87b297cc7b63c0af5aacd2 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 22 Jul 2024 00:35:01 +0530 Subject: [PATCH 22/47] build_J_W --- lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl index be4fa3e209..4852ef07da 100644 --- a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl +++ b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl @@ -11,7 +11,7 @@ import OrdinaryDiffEq: alg_order, calculate_residuals!, explicit_rk_docstring, trivial_limiter!, _ode_interpolant!, _ode_addsteps!, AbstractController, NLStatus, qmax_default, alg_adaptive_order, DEFAULT_PRECS, - UJacobianWrapper + UJacobianWrapper, build_J_W using MuladdMacro, DiffEqBase, RecursiveArrayTools import FastBroadcast: @.. include("algorithms.jl") From 2fb61937152f1f98cb9535f0896aa46f51406f7b Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 22 Jul 2024 11:16:28 +0530 Subject: [PATCH 23/47] build_jac_config --- lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl index 4852ef07da..d461fd677b 100644 --- a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl +++ b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl @@ -11,7 +11,7 @@ import OrdinaryDiffEq: alg_order, calculate_residuals!, explicit_rk_docstring, trivial_limiter!, _ode_interpolant!, _ode_addsteps!, AbstractController, NLStatus, qmax_default, alg_adaptive_order, DEFAULT_PRECS, - UJacobianWrapper, build_J_W + UJacobianWrapper, build_J_W, build_jac_config using MuladdMacro, DiffEqBase, RecursiveArrayTools import FastBroadcast: @.. include("algorithms.jl") From b018418bf1ea848df4e549f31c118d8d50f270df Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 22 Jul 2024 11:30:41 +0530 Subject: [PATCH 24/47] LinearSolve --- lib/OrdinaryDiffEqFIRK/Project.toml | 1 + lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/OrdinaryDiffEqFIRK/Project.toml b/lib/OrdinaryDiffEqFIRK/Project.toml index d890526dc1..8e5b30093a 100644 --- a/lib/OrdinaryDiffEqFIRK/Project.toml +++ b/lib/OrdinaryDiffEqFIRK/Project.toml @@ -7,6 +7,7 @@ version = "1.0.0" OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e" RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd" +LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae" [compat] julia = "1.10" diff --git a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl index d461fd677b..a0744f7310 100644 --- a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl +++ b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl @@ -13,6 +13,7 @@ import OrdinaryDiffEq: alg_order, calculate_residuals!, NLStatus, qmax_default, alg_adaptive_order, DEFAULT_PRECS, UJacobianWrapper, build_J_W, build_jac_config using MuladdMacro, DiffEqBase, RecursiveArrayTools +import LinearSolve import FastBroadcast: @.. include("algorithms.jl") include("alg_utils.jl") From 9996128936b02872c9bb3b50ed1a470d628e5ebb Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 22 Jul 2024 11:54:49 +0530 Subject: [PATCH 25/47] UDerivativeWrapper --- lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl index a0744f7310..a92f5e178b 100644 --- a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl +++ b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl @@ -11,7 +11,7 @@ import OrdinaryDiffEq: alg_order, calculate_residuals!, explicit_rk_docstring, trivial_limiter!, _ode_interpolant!, _ode_addsteps!, AbstractController, NLStatus, qmax_default, alg_adaptive_order, DEFAULT_PRECS, - UJacobianWrapper, build_J_W, build_jac_config + UJacobianWrapper, build_J_W, build_jac_config, UDerivativeWrapper using MuladdMacro, DiffEqBase, RecursiveArrayTools import LinearSolve import FastBroadcast: @.. From 626829c39dff72a8ecf6e653d68325419ad400f3 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 22 Jul 2024 12:37:13 +0530 Subject: [PATCH 26/47] SciMLOperators --- lib/OrdinaryDiffEqFIRK/Project.toml | 1 + lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/OrdinaryDiffEqFIRK/Project.toml b/lib/OrdinaryDiffEqFIRK/Project.toml index 8e5b30093a..dc41ee43e6 100644 --- a/lib/OrdinaryDiffEqFIRK/Project.toml +++ b/lib/OrdinaryDiffEqFIRK/Project.toml @@ -8,6 +8,7 @@ OrdinaryDiffEq = "1dea7af3-3e70-54e6-95c3-0bf5283fa5ed" DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e" RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd" LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae" +SciMLOperators = "c0aeaf25-5076-4817-a8d5-81caf7dfa961" [compat] julia = "1.10" diff --git a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl index a92f5e178b..33168991f3 100644 --- a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl +++ b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl @@ -13,6 +13,7 @@ import OrdinaryDiffEq: alg_order, calculate_residuals!, NLStatus, qmax_default, alg_adaptive_order, DEFAULT_PRECS, UJacobianWrapper, build_J_W, build_jac_config, UDerivativeWrapper using MuladdMacro, DiffEqBase, RecursiveArrayTools +using SciMLOperators: AbstractSciMLOperator import LinearSolve import FastBroadcast: @.. include("algorithms.jl") From c4e8e68e0fc3faf89b9749d8f5a6202f8a60f68e Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 22 Jul 2024 13:16:18 +0530 Subject: [PATCH 27/47] Convergence --- lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl index 33168991f3..ccbf65a856 100644 --- a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl +++ b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl @@ -11,7 +11,8 @@ import OrdinaryDiffEq: alg_order, calculate_residuals!, explicit_rk_docstring, trivial_limiter!, _ode_interpolant!, _ode_addsteps!, AbstractController, NLStatus, qmax_default, alg_adaptive_order, DEFAULT_PRECS, - UJacobianWrapper, build_J_W, build_jac_config, UDerivativeWrapper + UJacobianWrapper, build_J_W, build_jac_config, UDerivativeWrapper, + Convergence using MuladdMacro, DiffEqBase, RecursiveArrayTools using SciMLOperators: AbstractSciMLOperator import LinearSolve From 7856169c327ac21fbdff86b4547b47fb6e7f3e34 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 22 Jul 2024 13:26:36 +0530 Subject: [PATCH 28/47] calc_J! --- lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl index ccbf65a856..9dac68f57a 100644 --- a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl +++ b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl @@ -12,7 +12,7 @@ import OrdinaryDiffEq: alg_order, calculate_residuals!, _ode_interpolant!, _ode_addsteps!, AbstractController, NLStatus, qmax_default, alg_adaptive_order, DEFAULT_PRECS, UJacobianWrapper, build_J_W, build_jac_config, UDerivativeWrapper, - Convergence + Convergence, calc_J! using MuladdMacro, DiffEqBase, RecursiveArrayTools using SciMLOperators: AbstractSciMLOperator import LinearSolve From 06ae46e20fac63779e0aeb270596b7091b5bc46e Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 22 Jul 2024 13:39:08 +0530 Subject: [PATCH 29/47] LinearAlgebra --- lib/OrdinaryDiffEqFIRK/Project.toml | 1 + lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/OrdinaryDiffEqFIRK/Project.toml b/lib/OrdinaryDiffEqFIRK/Project.toml index dc41ee43e6..e87c1dd521 100644 --- a/lib/OrdinaryDiffEqFIRK/Project.toml +++ b/lib/OrdinaryDiffEqFIRK/Project.toml @@ -9,6 +9,7 @@ DiffEqBase = "2b5f629d-d688-5b77-993f-72d75c75574e" RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd" LinearSolve = "7ed4a6bd-45f5-4d41-b270-4a48e9bafcae" SciMLOperators = "c0aeaf25-5076-4817-a8d5-81caf7dfa961" +LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" [compat] julia = "1.10" diff --git a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl index 9dac68f57a..de2bff6afe 100644 --- a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl +++ b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl @@ -15,6 +15,7 @@ import OrdinaryDiffEq: alg_order, calculate_residuals!, Convergence, calc_J! using MuladdMacro, DiffEqBase, RecursiveArrayTools using SciMLOperators: AbstractSciMLOperator +using LinearAlgebra: I import LinearSolve import FastBroadcast: @.. include("algorithms.jl") From ed9e0016a7e3e1e4e6d1ba56346fb7fd8d56a540 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 22 Jul 2024 13:48:41 +0530 Subject: [PATCH 30/47] dolinsolve --- lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl index de2bff6afe..f37bb4875c 100644 --- a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl +++ b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl @@ -12,7 +12,7 @@ import OrdinaryDiffEq: alg_order, calculate_residuals!, _ode_interpolant!, _ode_addsteps!, AbstractController, NLStatus, qmax_default, alg_adaptive_order, DEFAULT_PRECS, UJacobianWrapper, build_J_W, build_jac_config, UDerivativeWrapper, - Convergence, calc_J! + Convergence, calc_J!, dolinsolve using MuladdMacro, DiffEqBase, RecursiveArrayTools using SciMLOperators: AbstractSciMLOperator using LinearAlgebra: I From c4ff15e57b2eddf2bc03a455481a4f0cfab56a1e Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 22 Jul 2024 14:01:09 +0530 Subject: [PATCH 31/47] FastConvergence --- lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl index f37bb4875c..862f778980 100644 --- a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl +++ b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl @@ -12,7 +12,7 @@ import OrdinaryDiffEq: alg_order, calculate_residuals!, _ode_interpolant!, _ode_addsteps!, AbstractController, NLStatus, qmax_default, alg_adaptive_order, DEFAULT_PRECS, UJacobianWrapper, build_J_W, build_jac_config, UDerivativeWrapper, - Convergence, calc_J!, dolinsolve + Convergence, calc_J!, dolinsolve, FastConvergence using MuladdMacro, DiffEqBase, RecursiveArrayTools using SciMLOperators: AbstractSciMLOperator using LinearAlgebra: I From eae3f1d8ba0ff019af2c75274dfb653a93da915b Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 22 Jul 2024 14:51:01 +0530 Subject: [PATCH 32/47] UniformScaling --- lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl index 862f778980..f49bed1464 100644 --- a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl +++ b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl @@ -12,10 +12,10 @@ import OrdinaryDiffEq: alg_order, calculate_residuals!, _ode_interpolant!, _ode_addsteps!, AbstractController, NLStatus, qmax_default, alg_adaptive_order, DEFAULT_PRECS, UJacobianWrapper, build_J_W, build_jac_config, UDerivativeWrapper, - Convergence, calc_J!, dolinsolve, FastConvergence + Convergence, calc_J!, dolinsolve, FastConvergence, calc_J using MuladdMacro, DiffEqBase, RecursiveArrayTools using SciMLOperators: AbstractSciMLOperator -using LinearAlgebra: I +using LinearAlgebra: I, UniformScaling import LinearSolve import FastBroadcast: @.. include("algorithms.jl") From a5a09fd4a81704892b8dd8c20bea3bf925ffd27b Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Mon, 22 Jul 2024 16:04:59 +0530 Subject: [PATCH 33/47] mul! --- lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl index f49bed1464..ff9dce0136 100644 --- a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl +++ b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl @@ -12,7 +12,8 @@ import OrdinaryDiffEq: alg_order, calculate_residuals!, _ode_interpolant!, _ode_addsteps!, AbstractController, NLStatus, qmax_default, alg_adaptive_order, DEFAULT_PRECS, UJacobianWrapper, build_J_W, build_jac_config, UDerivativeWrapper, - Convergence, calc_J!, dolinsolve, FastConvergence, calc_J + Convergence, calc_J!, dolinsolve, FastConvergence, calc_J, + mul! using MuladdMacro, DiffEqBase, RecursiveArrayTools using SciMLOperators: AbstractSciMLOperator using LinearAlgebra: I, UniformScaling From d0bef9ef662145c8179c65f1b3fae36f5ad6bccc Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Tue, 23 Jul 2024 07:08:24 -0400 Subject: [PATCH 34/47] Update lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl --- lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl index ff9dce0136..648efeb3a6 100644 --- a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl +++ b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl @@ -27,6 +27,6 @@ include("firk_tableaus.jl") include("firk_perform_step.jl") include("integrator_interface.jl") -export RadauIIA3, RadauIIA5 +export RadauIIA3, RadauIIA5, RadauIIA7 end From aae96bddfffdc22cee04e97441af36f6dbe7136c Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Tue, 23 Jul 2024 07:43:49 -0400 Subject: [PATCH 35/47] Update lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl --- lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl index 648efeb3a6..1d5463ecca 100644 --- a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl +++ b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl @@ -13,7 +13,7 @@ import OrdinaryDiffEq: alg_order, calculate_residuals!, NLStatus, qmax_default, alg_adaptive_order, DEFAULT_PRECS, UJacobianWrapper, build_J_W, build_jac_config, UDerivativeWrapper, Convergence, calc_J!, dolinsolve, FastConvergence, calc_J, - mul! + mul!, stepsize_controller! using MuladdMacro, DiffEqBase, RecursiveArrayTools using SciMLOperators: AbstractSciMLOperator using LinearAlgebra: I, UniformScaling From bccda66122701b3db75526fc8e2bc5d79c2d2c20 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Tue, 23 Jul 2024 17:03:43 -0400 Subject: [PATCH 36/47] Update lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl --- lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl index 1d5463ecca..4e7747a034 100644 --- a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl +++ b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl @@ -13,7 +13,7 @@ import OrdinaryDiffEq: alg_order, calculate_residuals!, NLStatus, qmax_default, alg_adaptive_order, DEFAULT_PRECS, UJacobianWrapper, build_J_W, build_jac_config, UDerivativeWrapper, Convergence, calc_J!, dolinsolve, FastConvergence, calc_J, - mul!, stepsize_controller! + stepsize_controller!, islinearfunction using MuladdMacro, DiffEqBase, RecursiveArrayTools using SciMLOperators: AbstractSciMLOperator using LinearAlgebra: I, UniformScaling From d84437bbcf70b3fca592421955b1855d6be653a8 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Tue, 23 Jul 2024 17:03:48 -0400 Subject: [PATCH 37/47] Update lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl --- lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl index 4e7747a034..40fc82f9f1 100644 --- a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl +++ b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl @@ -16,7 +16,7 @@ import OrdinaryDiffEq: alg_order, calculate_residuals!, stepsize_controller!, islinearfunction using MuladdMacro, DiffEqBase, RecursiveArrayTools using SciMLOperators: AbstractSciMLOperator -using LinearAlgebra: I, UniformScaling +using LinearAlgebra: I, UniformScaling, mul!, lu import LinearSolve import FastBroadcast: @.. include("algorithms.jl") From 96a8cc6cacc3d56fcd96f44b7696fe0263a01a56 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Wed, 24 Jul 2024 00:10:32 -0400 Subject: [PATCH 38/47] Update lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl --- lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl index 40fc82f9f1..a8cd30e428 100644 --- a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl +++ b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl @@ -13,7 +13,7 @@ import OrdinaryDiffEq: alg_order, calculate_residuals!, NLStatus, qmax_default, alg_adaptive_order, DEFAULT_PRECS, UJacobianWrapper, build_J_W, build_jac_config, UDerivativeWrapper, Convergence, calc_J!, dolinsolve, FastConvergence, calc_J, - stepsize_controller!, islinearfunction + stepsize_controller!, islinearfunction, step_accept_controller!, step_reject_controller! using MuladdMacro, DiffEqBase, RecursiveArrayTools using SciMLOperators: AbstractSciMLOperator using LinearAlgebra: I, UniformScaling, mul!, lu From 8c00b6ffd1c9894c9113458dc6b1613ac1fa3429 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Thu, 25 Jul 2024 08:42:57 +0530 Subject: [PATCH 39/47] Suggested changes made --- lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl | 2 +- lib/OrdinaryDiffEqFIRK/src/alg_utils.jl | 4 ++++ lib/OrdinaryDiffEqFIRK/src/controllers.jl | 5 +---- src/alg_utils.jl | 2 ++ src/integrators/controllers.jl | 6 +++--- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl index ff9dce0136..c606d2af88 100644 --- a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl +++ b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl @@ -13,7 +13,7 @@ import OrdinaryDiffEq: alg_order, calculate_residuals!, NLStatus, qmax_default, alg_adaptive_order, DEFAULT_PRECS, UJacobianWrapper, build_J_W, build_jac_config, UDerivativeWrapper, Convergence, calc_J!, dolinsolve, FastConvergence, calc_J, - mul! + mul!, PredictiveController using MuladdMacro, DiffEqBase, RecursiveArrayTools using SciMLOperators: AbstractSciMLOperator using LinearAlgebra: I, UniformScaling diff --git a/lib/OrdinaryDiffEqFIRK/src/alg_utils.jl b/lib/OrdinaryDiffEqFIRK/src/alg_utils.jl index 22fbb7a34f..ae8acba221 100644 --- a/lib/OrdinaryDiffEqFIRK/src/alg_utils.jl +++ b/lib/OrdinaryDiffEqFIRK/src/alg_utils.jl @@ -4,6 +4,10 @@ alg_order(alg::RadauIIA3) = 3 alg_order(alg::RadauIIA5) = 5 alg_order(alg::RadauIIA7) = 7 +isfirk(alg::RadauIIA3) = true +isfirk(alg::RadauIIA5) = true +isfirk(alg::RadauIIA7) = true + alg_adaptive_order(alg::RadauIIA3) = 1 alg_adaptive_order(alg::RadauIIA5) = 3 alg_adaptive_order(alg::RadauIIA7) = 5 diff --git a/lib/OrdinaryDiffEqFIRK/src/controllers.jl b/lib/OrdinaryDiffEqFIRK/src/controllers.jl index 33e87c3e29..fec2cc60a1 100644 --- a/lib/OrdinaryDiffEqFIRK/src/controllers.jl +++ b/lib/OrdinaryDiffEqFIRK/src/controllers.jl @@ -1,6 +1,3 @@ -struct PredictiveController <: AbstractController -end - @inline function stepsize_controller!(integrator, controller::PredictiveController, alg) @unpack qmin, qmax, gamma = integrator.opts EEst = DiffEqBase.value(integrator.EEst) @@ -11,7 +8,7 @@ end if fac_default_gamma(alg) fac = gamma else - if alg isa Union{RadauIIA3, RadauIIA5, RadauIIA7} + if isfirk(alg::Union{RadauIIA3, RadauIIA5, RadauIIA7}) @unpack iter = integrator.cache @unpack maxiters = alg else diff --git a/src/alg_utils.jl b/src/alg_utils.jl index 3bbe671a75..4120c7652b 100644 --- a/src/alg_utils.jl +++ b/src/alg_utils.jl @@ -50,6 +50,8 @@ isfsal(alg::PSRK3p5q4) = false isfsal(alg::PSRK3p6q5) = false isfsal(alg::PSRK4p7q6) = false +isfirk(alg) = false + get_current_isfsal(alg, cache) = isfsal(alg) # evaluates f(t[i]) diff --git a/src/integrators/controllers.jl b/src/integrators/controllers.jl index 63900cb5fe..10af114a40 100644 --- a/src/integrators/controllers.jl +++ b/src/integrators/controllers.jl @@ -1,9 +1,6 @@ abstract type AbstractController end using OrdinaryDiffEq -struct PredictiveController <: AbstractController -end - @inline function stepsize_controller!(integrator, alg) stepsize_controller!(integrator, integrator.opts.controller, alg) end @@ -397,6 +394,9 @@ end ``` """ +struct PredictiveController <: AbstractController +end + # Dummy controller without any method implementations. # This is used to transfer the special controllers associated to certain # algorithms to the new controller infrastructure with From 40b3b825bd47fdd0bba097a187bac9e5f8de7004 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Thu, 25 Jul 2024 08:59:28 +0530 Subject: [PATCH 40/47] alg_can_repeat_jac --- lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl index c9df48b1e4..c965e1fc5c 100644 --- a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl +++ b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl @@ -14,7 +14,7 @@ import OrdinaryDiffEq: alg_order, calculate_residuals!, UJacobianWrapper, build_J_W, build_jac_config, UDerivativeWrapper, Convergence, calc_J!, dolinsolve, FastConvergence, calc_J, stepsize_controller!, islinearfunction, step_accept_controller!, step_reject_controller!, - PredictiveController + PredictiveController, alg_can_repeat_jac using MuladdMacro, DiffEqBase, RecursiveArrayTools using SciMLOperators: AbstractSciMLOperator using LinearAlgebra: I, UniformScaling, mul!, lu From b66ecd394e74e660051cccf623fc4b60c42c089b Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Thu, 25 Jul 2024 09:14:45 +0530 Subject: [PATCH 41/47] fac_default_gamma --- lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl index c965e1fc5c..5f064f94e1 100644 --- a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl +++ b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl @@ -14,7 +14,7 @@ import OrdinaryDiffEq: alg_order, calculate_residuals!, UJacobianWrapper, build_J_W, build_jac_config, UDerivativeWrapper, Convergence, calc_J!, dolinsolve, FastConvergence, calc_J, stepsize_controller!, islinearfunction, step_accept_controller!, step_reject_controller!, - PredictiveController, alg_can_repeat_jac + PredictiveController, alg_can_repeat_jac, NewtonAlgorithm, fac_default_gamma using MuladdMacro, DiffEqBase, RecursiveArrayTools using SciMLOperators: AbstractSciMLOperator using LinearAlgebra: I, UniformScaling, mul!, lu From 77216cea3f88a5020515e671098918ed9b432411 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Thu, 25 Jul 2024 09:38:27 +0530 Subject: [PATCH 42/47] =?UTF-8?q?get=5Fnew=5FW=5F=CE=B3dt=5Fcutoff?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl index 5f064f94e1..63b64e0895 100644 --- a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl +++ b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl @@ -14,7 +14,8 @@ import OrdinaryDiffEq: alg_order, calculate_residuals!, UJacobianWrapper, build_J_W, build_jac_config, UDerivativeWrapper, Convergence, calc_J!, dolinsolve, FastConvergence, calc_J, stepsize_controller!, islinearfunction, step_accept_controller!, step_reject_controller!, - PredictiveController, alg_can_repeat_jac, NewtonAlgorithm, fac_default_gamma + PredictiveController, alg_can_repeat_jac, NewtonAlgorithm, fac_default_gamma, + get_new_W_γdt_cutoff using MuladdMacro, DiffEqBase, RecursiveArrayTools using SciMLOperators: AbstractSciMLOperator using LinearAlgebra: I, UniformScaling, mul!, lu From 1b4e2b7553bbf5f3527691d3099f9d229794e127 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Thu, 25 Jul 2024 09:52:39 +0530 Subject: [PATCH 43/47] get_current_adaptive_order --- lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl index 63b64e0895..50800dfeac 100644 --- a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl +++ b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl @@ -15,7 +15,7 @@ import OrdinaryDiffEq: alg_order, calculate_residuals!, Convergence, calc_J!, dolinsolve, FastConvergence, calc_J, stepsize_controller!, islinearfunction, step_accept_controller!, step_reject_controller!, PredictiveController, alg_can_repeat_jac, NewtonAlgorithm, fac_default_gamma, - get_new_W_γdt_cutoff + get_new_W_γdt_cutoff, get_current_adaptive_order using MuladdMacro, DiffEqBase, RecursiveArrayTools using SciMLOperators: AbstractSciMLOperator using LinearAlgebra: I, UniformScaling, mul!, lu From 838f2449fc45e74f71d19b43f456cf2269634528 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Thu, 25 Jul 2024 10:18:53 +0530 Subject: [PATCH 44/47] VerySlowConvergence --- lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl index 50800dfeac..9842247473 100644 --- a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl +++ b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl @@ -15,7 +15,7 @@ import OrdinaryDiffEq: alg_order, calculate_residuals!, Convergence, calc_J!, dolinsolve, FastConvergence, calc_J, stepsize_controller!, islinearfunction, step_accept_controller!, step_reject_controller!, PredictiveController, alg_can_repeat_jac, NewtonAlgorithm, fac_default_gamma, - get_new_W_γdt_cutoff, get_current_adaptive_order + get_new_W_γdt_cutoff, get_current_adaptive_order, VerySlowConvergence using MuladdMacro, DiffEqBase, RecursiveArrayTools using SciMLOperators: AbstractSciMLOperator using LinearAlgebra: I, UniformScaling, mul!, lu From aa3c3298c0fefabe294ad903d140ec43646317da Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Thu, 25 Jul 2024 11:05:51 +0530 Subject: [PATCH 45/47] alg --- lib/OrdinaryDiffEqFIRK/src/controllers.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqFIRK/src/controllers.jl b/lib/OrdinaryDiffEqFIRK/src/controllers.jl index fec2cc60a1..df6cf153ab 100644 --- a/lib/OrdinaryDiffEqFIRK/src/controllers.jl +++ b/lib/OrdinaryDiffEqFIRK/src/controllers.jl @@ -8,7 +8,7 @@ if fac_default_gamma(alg) fac = gamma else - if isfirk(alg::Union{RadauIIA3, RadauIIA5, RadauIIA7}) + if isfirk(alg) @unpack iter = integrator.cache @unpack maxiters = alg else From e0edf35436902a3989f98d3f5c38de8b4ba2c411 Mon Sep 17 00:00:00 2001 From: ParamThakkar123 Date: Thu, 25 Jul 2024 14:06:25 +0530 Subject: [PATCH 46/47] Divergence --- lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl index 9842247473..f50ebd1654 100644 --- a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl +++ b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl @@ -15,7 +15,8 @@ import OrdinaryDiffEq: alg_order, calculate_residuals!, Convergence, calc_J!, dolinsolve, FastConvergence, calc_J, stepsize_controller!, islinearfunction, step_accept_controller!, step_reject_controller!, PredictiveController, alg_can_repeat_jac, NewtonAlgorithm, fac_default_gamma, - get_new_W_γdt_cutoff, get_current_adaptive_order, VerySlowConvergence + get_new_W_γdt_cutoff, get_current_adaptive_order, VerySlowConvergence, + Divergence using MuladdMacro, DiffEqBase, RecursiveArrayTools using SciMLOperators: AbstractSciMLOperator using LinearAlgebra: I, UniformScaling, mul!, lu From 66d3a867cfcad38bd5a50a97e27b9e71b7f92bb4 Mon Sep 17 00:00:00 2001 From: Christopher Rackauckas Date: Fri, 26 Jul 2024 08:00:42 -0400 Subject: [PATCH 47/47] Update lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl --- lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl index f50ebd1654..d49edd4a1b 100644 --- a/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl +++ b/lib/OrdinaryDiffEqFIRK/src/OrdinaryDiffEqFIRK.jl @@ -16,7 +16,7 @@ import OrdinaryDiffEq: alg_order, calculate_residuals!, stepsize_controller!, islinearfunction, step_accept_controller!, step_reject_controller!, PredictiveController, alg_can_repeat_jac, NewtonAlgorithm, fac_default_gamma, get_new_W_γdt_cutoff, get_current_adaptive_order, VerySlowConvergence, - Divergence + Divergence, isfirk using MuladdMacro, DiffEqBase, RecursiveArrayTools using SciMLOperators: AbstractSciMLOperator using LinearAlgebra: I, UniformScaling, mul!, lu