diff --git a/test/Downstream/Project.toml b/test/Downstream/Project.toml index 81edbff6..df435b37 100644 --- a/test/Downstream/Project.toml +++ b/test/Downstream/Project.toml @@ -25,7 +25,7 @@ ModelingToolkit = "8.33, 9, 10, 11" MonteCarloMeasurements = "1.1" NLsolve = "4" OrdinaryDiffEq = "6.31, 7" -OrdinaryDiffEqRosenbrock = "1, 2" +OrdinaryDiffEqRosenbrock = "2.6.1" StaticArrays = "1" RecursiveArrayTools = "4" RecursiveArrayToolsShorthandConstructors = "1" diff --git a/test/Downstream/odesolve.jl b/test/Downstream/odesolve.jl index 5fe162d8..1703461d 100644 --- a/test/Downstream/odesolve.jl +++ b/test/Downstream/odesolve.jl @@ -52,7 +52,7 @@ end AutoTsit5(Rodas5()) ).retcode == ReturnCode.Success -@test_broken solve( +@test solve( ODEProblem( dyn, ArrayPartition( @@ -74,3 +74,22 @@ u = fill(SVector{2}(ones(2)), 2, 3) ode = ODEProblem(rhs!, VectorOfArray(u), (0.0, 1.0)) sol = solve(ode, Tsit5()) @test successful_retcode(sol) + +# VectorOfArray whose outer storage is itself immutable +function decay!(dQ, Q, p, t) + dQ[:, 1] .= @view Q[:, 1] + dQ[:, 2] .= @view Q[:, 2] + return nothing +end + +u0 = [randn(5), randn(5)] +exact = reduce(hcat, u .* exp(1.0) for u in u0) +for alg in (Tsit5(), Rosenbrock23()) + local Q = VectorOfArray(SVector{2}(deepcopy(u0))) + local sol = solve( + ODEProblem(decay!, Q, (0.0, 1.0)), alg, abstol = 1.0e-10, reltol = 1.0e-10 + ) + @test successful_retcode(sol) + @test sol.u[end] isa typeof(Q) + @test Array(sol.u[end]) ≈ exact rtol = 1.0e-5 +end