@@ -43,31 +43,3 @@ sol = solve(prob2, Rosenbrock23(autodiff = AutoForwardDiff(chunksize = 1)))
4343
4444sol = solve (prob2, Rosenbrock23 (autodiff = AutoFiniteDiff ()))
4545@test ≈ (good_sol[:, end ], sol[:, end ], rtol = 1.0e-2 )
46-
47- # Regression test for issue #3232:
48- # OrdinaryDiffEqLinearExponentialAlgorithm subtypes (MagnusGL6, etc.)
49- # have no `autodiff` field; _alg_autodiff and prepare_alg must not crash.
50- using OrdinaryDiffEqDifferentiation: _alg_autodiff
51- using OrdinaryDiffEqCore: OrdinaryDiffEqLinearExponentialAlgorithm
52- using DiffEqBase: prepare_alg
53-
54- struct MockMagnusAlg <: OrdinaryDiffEqLinearExponentialAlgorithm
55- krylov:: Bool
56- m:: Int
57- iop:: Int
58- end
59-
60- @testset " LinearExponentialAlgorithm autodiff traits (issue #3232)" begin
61- mock = MockMagnusAlg (false , 30 , 0 )
62-
63- # _alg_autodiff must return Val{false}() instead of accessing alg.autodiff
64- @test _alg_autodiff (mock) == Val {false} ()
65-
66- # prepare_alg must return the algorithm unchanged (no AD preparation needed)
67- u0 = ones (2 )
68- mock_prob = ODEProblem ((du, u, p, t) -> du .= 0 , u0, (0.0 , 1.0 ))
69- @test prepare_alg (mock, u0, nothing , mock_prob) === mock
70-
71- # forwarddiffs_model must return false
72- @test SciMLBase. forwarddiffs_model (mock) == false
73- end
0 commit comments