Skip to content

Commit 9d6ef96

Browse files
don't mutate solution
1 parent f53d32c commit 9d6ef96

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/integrators/integrator_utils.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,23 +65,23 @@ end
6565
warn("Max Iters Reached. Aborting")
6666
end
6767
postamble!(integrator)
68-
integrator.sol.retcode = :MaxIters
68+
integrator.sol = solution_new_retcode(integrator.sol,:MaxIters)
6969
return integrator.sol
7070
end
7171
if !integrator.opts.force_dtmin && integrator.opts.adaptive && abs(integrator.dt) <= abs(integrator.opts.dtmin)
7272
if integrator.opts.verbose
7373
warn("dt <= dtmin. Aborting. If you would like to force continuation with dt=dtmin, set force_dtmin=true")
7474
end
7575
postamble!(integrator)
76-
integrator.sol.retcode = :DtLessThanMin
76+
integrator.sol = solution_new_retcode(integrator.sol,:DtLessThanMin)
7777
return integrator.sol
7878
end
7979
if integrator.opts.unstable_check(integrator.dt,integrator.t,integrator.u)
8080
if integrator.opts.verbose
8181
warn("Instability detected. Aborting")
8282
end
8383
postamble!(integrator)
84-
integrator.sol.retcode = :Unstable
84+
integrator.sol = solution_new_retcode(integrator.sol,:Unstable)
8585
return integrator.sol
8686
end
8787
end

src/solve.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,6 @@ function solve!(integrator::SDEIntegrator)
438438
if has_analytic(f)
439439
calculate_solution_errors!(integrator.sol;timeseries_errors=integrator.opts.timeseries_errors,dense_errors=integrator.opts.dense_errors)
440440
end
441-
integrator.sol.retcode = :Success
441+
integrator.sol = solution_new_retcode(integrator.sol,:Success)
442442
nothing
443443
end

0 commit comments

Comments
 (0)