Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support SciMLBase.remake_initializeprob #2844

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/systems/nonlinear/initializesystem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -107,3 +107,13 @@ function generate_initializesystem(sys::ODESystem;

return sys_nl
end

function SciMLBase.remake_initializeprob(sys::ODESystem, odefn, u0, t0, p)
if !(eltype(u0) <: Pair) && !isempty(u0)
return odefn.initializeprob, odefn.initializeprobmap
end
initprob = InitializationProblem(sys, t0, u0, p)
display(initprob.f.sys); @show equations(initprob.f.sys)
initprobmap = getu(initprob, unknowns(sys))
return initprob, initprobmap
end
Loading