Skip to content

Commit

Permalink
Write checkpoint when end simulation time has been reached (#1218)
Browse files Browse the repository at this point in the history
Description
This small change ensures that a checkpoint is written if the end simulation time has been reached regardless of the frequency for the check pointing specified in the parameter file.

Testing
All test involving a restart should pass without any issue. I have tested the feature with an example on my local machine and it works as expected.

Documentation
No change needed in the documentation.
  • Loading branch information
lpsaavedra authored Aug 2, 2024
1 parent 36d01c2 commit f49de88
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions source/solvers/navier_stokes_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -530,9 +530,10 @@ NavierStokesBase<dim, VectorType, DofsType>::finish_time_step()
}
if (this->simulation_parameters.restart_parameters.checkpoint &&
simulation_control->get_step_number() != 0 &&
simulation_control->get_step_number() %
this->simulation_parameters.restart_parameters.frequency ==
0)
(simulation_control->get_step_number() %
this->simulation_parameters.restart_parameters.frequency ==
0 ||
simulation_control->is_at_end()))
{
this->write_checkpoint();
}
Expand Down

0 comments on commit f49de88

Please sign in to comment.