add post yes/no keyword to rerun commmand (with default to no)

This commit is contained in:
Axel Kohlmeyer
2021-04-05 15:38:59 -04:00
parent e00e2676fc
commit fc6e10921d
2 changed files with 18 additions and 3 deletions

View File

@ -51,6 +51,7 @@ void Rerun::command(int narg, char **arg)
if (strcmp(arg[iarg],"start") == 0) break;
if (strcmp(arg[iarg],"stop") == 0) break;
if (strcmp(arg[iarg],"dump") == 0) break;
if (strcmp(arg[iarg],"post") == 0) break;
iarg++;
}
int nfile = iarg;
@ -65,6 +66,7 @@ void Rerun::command(int narg, char **arg)
int nskip = 1;
int startflag = 0;
int stopflag = 0;
int postflag = 0;
bigint start = -1;
bigint stop = -1;
@ -101,6 +103,14 @@ void Rerun::command(int narg, char **arg)
stop = utils::bnumeric(FLERR,arg[iarg+1],false,lmp);
if (stop < 0) error->all(FLERR,"Illegal rerun command");
iarg += 2;
} else if (strcmp(arg[iarg],"post") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal rerun command");
if (strcmp(arg[iarg+1],"yes") == 0) {
postflag = 1;
} else if (strcmp(arg[iarg+1],"no") == 0) {
postflag = 0;
} else error->all(FLERR,"Illegal rerun command");
iarg += 2;
} else if (strcmp(arg[iarg],"dump") == 0) {
break;
} else error->all(FLERR,"Illegal rerun command");
@ -182,7 +192,7 @@ void Rerun::command(int narg, char **arg)
update->nsteps = ndump;
Finish finish(lmp);
finish.end(1);
finish.end(postflag);
update->whichflag = 0;
update->firststep = update->laststep = 0;