add support for "error continue" option, which resets the timer timeout setting after a soft exit

This commit is contained in:
Axel Kohlmeyer
2016-10-18 12:21:27 -04:00
parent 394c3bb504
commit 1f1c87235a
2 changed files with 12 additions and 3 deletions

View File

@ -109,6 +109,7 @@ int FixHalt::setmask()
{
int mask = 0;
mask |= END_OF_STEP;
mask |= POST_RUN;
return mask;
}
@ -170,14 +171,21 @@ void FixHalt::end_of_step()
id,update->ntimestep,attvalue);
if (eflag == HARD) error->all(FLERR,str);
else if (eflag == SOFT) {
else if (eflag == SOFT || eflag == CONTINUE) {
if (comm->me == 0) error->message(FLERR,str);
timer->force_timeout();
} else if (eflag == CONTINUE) {
// exit this run, but not subsequent ones
}
}
/* ----------------------------------------------------------------------
reset expired timer setting to original value, if requested
------------------------------------------------------------------------- */
void FixHalt::post_run()
{
if (eflag == CONTINUE) timer->reset_timeout();
}
/* ----------------------------------------------------------------------
compute max length of any bond using Neighbor bondlist for each proc
------------------------------------------------------------------------- */