Skip to content

Commit 9564e24

Browse files
committed
deepcopy integrator.sol.W to prob.noise
1 parent 6cf5985 commit 9564e24

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/solve.jl

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ function DiffEqBase.__solve(prob::DiffEqBase.AbstractRODEProblem,
55
kwargs...) where recompile_flag
66
integrator = DiffEqBase.__init(prob,alg,timeseries,ts,recompile;kwargs...)
77
solve!(integrator)
8-
deepcopy(integrator.sol)
8+
if typeof(prob) <: DiffEqBase.AbstractRODEProblem
9+
# better to make the following a function in DiffEqNoiseProcess
10+
for x in fieldnames(typeof(prob.noise))
11+
setfield!(prob.noise, x, deepcopy(getfield(integrator.sol.W, x)))
12+
end
13+
end
14+
integrator.sol
915
end
1016

1117
# Make it easy to grab the RODEProblem/SDEProblem/DiscreteProblem from the keyword arguments
@@ -412,7 +418,7 @@ function DiffEqBase.__init(
412418
=#
413419
end
414420
elseif typeof(prob) <: DiffEqBase.AbstractRODEProblem
415-
W = prob.noise
421+
W = deepcopy(prob.noise)
416422
if W.reset
417423
if W.curt != t
418424
reinit!(W,t,t0=t)

0 commit comments

Comments
 (0)