Skip to content

Commit 15df733

Browse files
Merge pull request #1072 from albertomercurio/master
Add methods for SDEFunction in case of SciMLOperators v1+
2 parents ac1127f + 60da2ff commit 15df733

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

src/scimlfunctions.jl

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2644,6 +2644,26 @@ function Base.getproperty(f::DynamicalDDEFunction, name::Symbol)
26442644
end
26452645

26462646
(f::SDEFunction)(args...) = f.f(args...)
2647+
2648+
@static if isdefined(SciMLOperators, :isv1)
2649+
function (f::SDEFunction)(du, u, p, t)
2650+
if f.f isa AbstractSciMLOperator
2651+
f.f(du, u, u, p, t)
2652+
else
2653+
f.f(du, u, p, t)
2654+
end
2655+
end
2656+
2657+
function (f::SDEFunction)(u, p, t)
2658+
if f.f isa AbstractSciMLOperator
2659+
f.f(u, u, p, t)
2660+
else
2661+
f.f(u, p, t)
2662+
end
2663+
end
2664+
end
2665+
2666+
26472667
(f::SDDEFunction)(args...) = f.f(args...)
26482668
(f::SplitSDEFunction)(u, p, t) = f.f1(u, p, t) + f.f2(u, p, t)
26492669

0 commit comments

Comments
 (0)