diff --git a/Project.toml b/Project.toml index 09c4bd7b..cc8fe14d 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "BoundaryValueDiffEq" uuid = "764a87c0-6b3e-53db-9096-fe964310641d" -version = "5.9.0" +version = "5.9.1" [deps] ADTypes = "47edcb42-4c32-4615-8424-f2b9edc5f35b" diff --git a/src/solve/mirk.jl b/src/solve/mirk.jl index 01bafb48..725e4074 100644 --- a/src/solve/mirk.jl +++ b/src/solve/mirk.jl @@ -56,8 +56,7 @@ function SciMLBase.__init(prob::BVProblem, alg::AbstractMIRK; dt = 0.0, k_discrete = [__maybe_allocate_diffcache(similar(X, N, stage), chunksize, alg.jac_alg) for _ in 1:Nig] - k_interp = [similar(X, ifelse(adaptive, N, 0), ifelse(adaptive, ITU.s_star - stage, 0)) - for _ in 1:Nig] + k_interp = [similar(X, N, ITU.s_star - stage) for _ in 1:Nig] bcresid_prototype, resid₁_size = __get_bcresid_prototype(prob.problem_type, prob, X) @@ -72,7 +71,7 @@ function SciMLBase.__init(prob::BVProblem, alg::AbstractMIRK; dt = 0.0, end defect = [similar(X, ifelse(adaptive, N, 0)) for _ in 1:Nig] - new_stages = [similar(X, ifelse(adaptive, N, 0)) for _ in 1:Nig] + new_stages = [similar(X, N) for _ in 1:Nig] # Transform the functions to handle non-vector inputs bcresid_prototype = __vec(bcresid_prototype) diff --git a/test/mirk/mirk_basic_tests.jl b/test/mirk/mirk_basic_tests.jl index ebee9d64..6d5412a4 100644 --- a/test/mirk/mirk_basic_tests.jl +++ b/test/mirk/mirk_basic_tests.jl @@ -175,13 +175,21 @@ end @eval mirk_solver(::Val{$order}) = $(s)() end - @testset "MIRK$order" for order in (2, 3, 4, 5, 6) + @testset "Interpolation for adaptive MIRK$order" for order in (2, 3, 4, 5, 6) sol = solve(prob_bvp_linear, mirk_solver(Val(order)); dt = 0.001) @test sol(0.001)≈[0.998687464, -1.312035941] atol=testTol @test sol(0.001; idxs = [1, 2])≈[0.998687464, -1.312035941] atol=testTol @test sol(0.001; idxs = 1)≈0.998687464 atol=testTol @test sol(0.001; idxs = 2)≈-1.312035941 atol=testTol end + + @testset "Interpolation for non-adaptive MIRK$order" for order in (2, 3, 4, 5, 6) + sol = solve(prob_bvp_linear, mirk_solver(Val(order)); dt = 0.001, adaptive=false) + @test_nowarn sol(0.01) + @test_nowarn sol(0.01; idxs = [1, 2]) + @test_nowarn sol(0.01; idxs = 1) + @test_nowarn sol(0.01; idxs = 2) + end end @testitem "Swirling Flow III" begin