Skip to content

Commit bd2d461

Browse files
fix: handle different SciMLFunctions in get_root_indp
1 parent 336ea0c commit bd2d461

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

src/solutions/save_idxs.jl

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,17 @@ function as_diffeq_array(vt::Vector{VectorTemplate}, t)
4545
end
4646

4747
function get_root_indp(prob::AbstractSciMLProblem)
48-
prob.f.sys
48+
get_root_indp(prob.f)
49+
end
50+
51+
function get_root_indp(f::T) where {T <: AbstractSciMLFunction}
52+
if hasfield(T, :sys)
53+
return f.sys
54+
elseif hasfield(T, :f) && f.f isa AbstractSciMLFunction
55+
return get_root_indp(f.f)
56+
else
57+
return nothing
58+
end
4959
end
5060

5161
function get_root_indp(prob::LinearProblem)

0 commit comments

Comments
 (0)