Skip to content

Commit 854b472

Browse files
Merge pull request #1163 from AayushSabharwal/as/null-integrator-interface
feat: implement some of the integrator interface for `NullODEIntegrator`
2 parents 41be74a + 950b26d commit 854b472

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/solve.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,8 @@ function step!(integ::NullODEIntegrator, dt = nothing, stop_at_tdt = false)
710710
end
711711
return nothing
712712
end
713+
function SciMLBase.u_modified!(integ::NullODEIntegrator, u) end
714+
SciMLBase.check_error(integ::NullODEIntegrator) = integ.sol.retcode
713715

714716
function hack_null_solution_init(prob)
715717
if SciMLBase.has_initialization_data(prob.f)

test/downstream/null_de.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,10 @@ end
8888
sol = solve(prob)
8989
@test sol.resid isa SVector{1, Float64}
9090
end
91+
92+
@testset "`u_modified!` works on null integrators" begin
93+
prob = ODEProblem(Returns(nothing), nothing, (0.0, 1.0))
94+
integ = init(prob, Tsit5())
95+
@test_nowarn SciMLBase.u_modified!(integ, Float64[])
96+
@test SciMLBase.successful_retcode(SciMLBase.check_error(integ))
97+
end

0 commit comments

Comments
 (0)