Skip to content

Commit

Permalink
save results even if simulation failed
Browse files Browse the repository at this point in the history
  • Loading branch information
reid23 authored Jun 3, 2024
1 parent e0c4239 commit c4e77c4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/base/simulation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -543,14 +543,14 @@ function _execute!(sim::Simulation, solver; kwargs...)
initializealg = SciMLBase.NoInit(),
_filter_kwargs(kwargs)...,
)
sim.results = SimulationResults(
get_simulation_inputs(sim),
get_system(sim),
time_log,
solution,
)
if SciMLBase.successful_retcode(solution)
sim.status = SIMULATION_FINALIZED
sim.results = SimulationResults(
get_simulation_inputs(sim),
get_system(sim),
time_log,
solution,
)
else
@error("The simulation failed with return code $(solution.retcode)")
sim.status = SIMULATION_FAILED
Expand Down

0 comments on commit c4e77c4

Please sign in to comment.