Skip to content

Commit b720c53

Browse files
feat: implement u_modified! for null integrator
1 parent 41be74a commit b720c53

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/solve.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -710,6 +710,7 @@ 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
713714

714715
function hack_null_solution_init(prob)
715716
if SciMLBase.has_initialization_data(prob.f)

test/downstream/null_de.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,9 @@ 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+
end

0 commit comments

Comments
 (0)