Skip to content

Commit a001d10

Browse files
authored
save results even if simulation failed (#378)
1 parent cda76eb commit a001d10

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/base/simulation.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -543,14 +543,14 @@ function _execute!(sim::Simulation, solver; kwargs...)
543543
initializealg = SciMLBase.NoInit(),
544544
_filter_kwargs(kwargs)...,
545545
)
546+
sim.results = SimulationResults(
547+
get_simulation_inputs(sim),
548+
get_system(sim),
549+
time_log,
550+
solution,
551+
)
546552
if SciMLBase.successful_retcode(solution)
547553
sim.status = SIMULATION_FINALIZED
548-
sim.results = SimulationResults(
549-
get_simulation_inputs(sim),
550-
get_system(sim),
551-
time_log,
552-
solution,
553-
)
554554
else
555555
@error("The simulation failed with return code $(solution.retcode)")
556556
sim.status = SIMULATION_FAILED

0 commit comments

Comments
 (0)