Skip to content

Commit

Permalink
Merge pull request #389 from SciML/ChrisRackauckas-patch-2
Browse files Browse the repository at this point in the history
Allow NonlinearProblem in SteadyStateAdjoint
  • Loading branch information
ChrisRackauckas authored Feb 7, 2021
2 parents b1247e2 + 59e391c commit b592616
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/concrete_solve.jl
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ function DiffEqBase._concrete_solve_adjoint(prob,alg,sensealg::Nothing,u0,p,args
DiffEqBase._concrete_solve_adjoint(prob,alg,default_sensealg,u0,p,args...;kwargs...)
end

function DiffEqBase._concrete_solve_adjoint(prob::SteadyStateProblem,alg,sensealg::Nothing,u0,p,args...;kwargs...)
function DiffEqBase._concrete_solve_adjoint(prob::Union{NonlinearProblem,SteadyStateProblem},alg,
sensealg::Nothing,u0,p,args...;kwargs...)
default_sensealg = SteadyStateAdjoint()
DiffEqBase._concrete_solve_adjoint(prob,alg,default_sensealg,u0,p,args...;kwargs...)
end
Expand Down Expand Up @@ -410,8 +411,9 @@ function DiffEqBase._concrete_solve_adjoint(prob,alg,sensealg::ReverseDiffAdjoin
end


function DiffEqBase._concrete_solve_adjoint(prob::SteadyStateProblem,alg,sensealg::SteadyStateAdjoint,
u0,p,args...;save_idxs = nothing, kwargs...)
function DiffEqBase._concrete_solve_adjoint(prob::Union{NonlinearProblem,SteadyStateProblem},
alg,sensealg::SteadyStateAdjoint,
u0,p,args...;save_idxs = nothing, kwargs...)

_prob = remake(prob,u0=u0,p=p)
sol = solve(_prob,alg,args...;kwargs...)
Expand Down

0 comments on commit b592616

Please sign in to comment.