From aa3a3c34b1662fdbde942231aaf0320089cba7fb Mon Sep 17 00:00:00 2001 From: Aayush Sabharwal Date: Tue, 28 May 2024 15:53:12 +0530 Subject: [PATCH] feat: solve initialization problem for null solutions/integrators --- src/solve.jl | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/src/solve.jl b/src/solve.jl index 989870c10..a098f3278 100644 --- a/src/solve.jl +++ b/src/solve.jl @@ -676,7 +676,21 @@ function build_null_solution(prob::AbstractDEProblem, args...; timeseries = [Float64[] for i in 1:length(ts)] - build_solution(prob, nothing, ts, timeseries, retcode = ReturnCode.Success) + sol = build_solution(prob, nothing, ts, timeseries, retcode = ReturnCode.Success) + if SciMLBase.has_initializeprob(prob.f) + integ = NullODEIntegrator{ + isinplace(prob), typeof(prob), eltype(prob.tspan), typeof(sol), + typeof(prob.f), typeof(prob.p) + }(Float64[], + Float64[], + prob.tspan[1], + prob, + sol, + prob.f, + prob.p) + initialize_dae!(integ) + end + return sol end function build_null_solution(