Skip to content

Commit

Permalink
Merge 009548a into 282c90a
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisRackauckas committed Aug 24, 2022
2 parents 282c90a + 009548a commit bf7d718
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 39 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ PoissonRandom = "0.4"
RandomNumbers = "1.3"
RecursiveArrayTools = "2"
Reexport = "0.2, 1.0"
SciMLBase = "1.35.1"
SciMLBase = "1.51"
StaticArrays = "0.10, 0.11, 0.12, 1.0"
TreeViews = "0.3"
UnPack = "1.0.2"
Expand Down
39 changes: 6 additions & 33 deletions src/coupling.jl
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,8 @@ function cat_problems(prob::DiffEqBase.AbstractODEProblem,
prob_control::DiffEqBase.AbstractODEProblem)
l = length(prob.u0) # add l_c = length(prob_control.u0)

if isdefined(SciMLBase, :unwrapped_f)
_f = SciMLBase.unwrapped_f(prob.f)
else
_f = prob.f
end

if isdefined(SciMLBase, :unwrapped_f)
_f_control = SciMLBase.unwrapped_f(prob_control.f)
else
_f_control = prob_control.f
end
_f = SciMLBase.unwrapped_f(prob.f)
_f_control = SciMLBase.unwrapped_f(prob_control.f)

new_f = function (du, u, p, t)
_f(@view(du[1:l]), u.u, p, t)
Expand All @@ -47,17 +38,8 @@ function cat_problems(prob::DiscreteProblem, prob_control::DiffEqBase.AbstractOD
@warn("Coupling to DiscreteProblem with nontrivial f. Note that, unless scale_by_time=true, the meaning of f will change when using an ODE/SDE/DDE/DAE solver.")
end

if isdefined(SciMLBase, :unwrapped_f)
_f = SciMLBase.unwrapped_f(prob.f)
else
_f = prob.f
end

if isdefined(SciMLBase, :unwrapped_f)
_f_control = SciMLBase.unwrapped_f(prob_control.f)
else
_f_control = prob_control.f
end
_f = SciMLBase.unwrapped_f(prob.f)
_f_control = SciMLBase.unwrapped_f(prob_control.f)

new_f = function (du, u, p, t)
_f(@view(du[1:l]), u.u, p, t)
Expand Down Expand Up @@ -86,17 +68,8 @@ function cat_problems(prob::DiffEqBase.AbstractSDEProblem,
prob_control::DiffEqBase.AbstractODEProblem)
l = length(prob.u0)

if isdefined(SciMLBase, :unwrapped_f)
_f = SciMLBase.unwrapped_f(prob.f)
else
_f = prob.f
end

if isdefined(SciMLBase, :unwrapped_f)
_f_control = SciMLBase.unwrapped_f(prob_control.f)
else
_f_control = prob_control.f
end
_f = SciMLBase.unwrapped_f(prob.f)
_f_control = SciMLBase.unwrapped_f(prob_control.f)

new_f = function (du, u, p, t)
_f(@view(du[1:l]), u.u, p, t)
Expand Down
7 changes: 2 additions & 5 deletions src/problem.jl
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,8 @@ function extend_problem(prob::DiffEqBase.AbstractDiscreteProblem, jumps; rng = D
end

function extend_problem(prob::DiffEqBase.AbstractODEProblem, jumps; rng = DEFAULT_RNG)
if isdefined(SciMLBase, :unwrapped_f)
_f = SciMLBase.unwrapped_f(prob.f)
else
_f = prob.f
end

_f = SciMLBase.unwrapped_f(prob.f)

jump_f = let _f = _f
function jump_f(du::ExtendedJumpArray, u::ExtendedJumpArray, p, t)
Expand Down

0 comments on commit bf7d718

Please sign in to comment.