From e3598220d9346c3cbcf4b6c1363b65b8d9fe1423 Mon Sep 17 00:00:00 2001 From: Daniel VandenHeuvel <95613936+DanielVandH@users.noreply.github.com> Date: Tue, 10 Dec 2024 13:45:25 +0000 Subject: [PATCH 1/2] Don't check for breakdown if adaptive=false --- Project.toml | 2 +- src/krylov_phiv_adaptive.jl | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Project.toml b/Project.toml index 2f07565..0d2dcf0 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "ExponentialUtilities" uuid = "d4d017d3-3776-5f7e-afef-a10c40355c18" authors = ["Chris Rackauckas ", "José E. Cruz Serrallés "] -version = "1.27.0" +version = "1.27.1" [deps] Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e" diff --git a/src/krylov_phiv_adaptive.jl b/src/krylov_phiv_adaptive.jl index 9ab8787..631746d 100644 --- a/src/krylov_phiv_adaptive.jl +++ b/src/krylov_phiv_adaptive.jl @@ -74,7 +74,7 @@ Niesen & Wright is used, the relative tolerance of which can be set using the keyword parameter `tol`. The delta and gamma parameters of the adaptation scheme can also be adjusted. -When encountering a happy breakdown in the Krylov subspace construction, the +When encountering a happy breakdown in the Krylov subspace construction and `adaptive=true`, the time step is set to the remainder of the time interval since time stepping is no longer necessary. @@ -180,7 +180,7 @@ function phiv_timestep!(U::AbstractMatrix{T}, ts::Vector{tType}, A, B::AbstractM end # Part 2: compute ϕp(tau*A)wp using Krylov, possibly with adaptation arnoldi!(Ks, A, @view(W[:, end]); tol = tol, m = m, opnorm = opnorm, iop = iop) - if Ks.wasbreakdown + if adaptive && Ks.wasbreakdown tau = tend - t end _, epsilon = phiv!(P, tau, Ks, p + 1; cache = phiv_cache, correct = correct, From 8056007b917acaf164bedd82206d42e5dbbf50af Mon Sep 17 00:00:00 2001 From: Daniel VandenHeuvel <95613936+DanielVandH@users.noreply.github.com> Date: Tue, 10 Dec 2024 14:05:52 +0000 Subject: [PATCH 2/2] 143 regression? --- test/basictests.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/basictests.jl b/test/basictests.jl index 08da3b7..b2d5317 100644 --- a/test/basictests.jl +++ b/test/basictests.jl @@ -119,13 +119,13 @@ end if VERSION >= v"1.7" out = Pipe() res = redirect_stdout(out) do - expv_timestep(ts, reshape([1], (1, 1)), [1.0]; verbose = true) + expv_timestep(ts, reshape([1], (1, 1)), [1.0]; verbose = true, adaptive = true) end close(Base.pipe_writer(out)) @test occursin("Completed after 1 time step(s)", read(out, String)) else - res = expv_timestep(ts, reshape([1], (1, 1)), [1.0]; verbose = true) + res = expv_timestep(ts, reshape([1], (1, 1)), [1.0]; verbose = true, adaptive = true) end @test vec(res) ≈ exp.(ts)