Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't check for breakdown if adaptive=false #185

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "ExponentialUtilities"
uuid = "d4d017d3-3776-5f7e-afef-a10c40355c18"
authors = ["Chris Rackauckas <[email protected]>", "José E. Cruz Serrallés <[email protected]>"]
version = "1.27.0"
version = "1.27.1"

[deps]
Adapt = "79e6a3ab-5dfb-504d-930d-738a2a938a0e"
Expand Down
4 changes: 2 additions & 2 deletions src/krylov_phiv_adaptive.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down Expand Up @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions test/basictests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Loading