detect and error out when timestep was reset when restarting fixes atom/swap, gcmc, or deposit
This commit is contained in:
@ -798,11 +798,12 @@ void FixDeposit::options(int narg, char **arg)
|
||||
void FixDeposit::write_restart(FILE *fp)
|
||||
{
|
||||
int n = 0;
|
||||
double list[4];
|
||||
double list[5];
|
||||
list[n++] = random->state();
|
||||
list[n++] = ninserted;
|
||||
list[n++] = nfirst;
|
||||
list[n++] = ubuf(next_reneighbor).d;
|
||||
list[n++] = ubuf(update->ntimestep).d;
|
||||
|
||||
if (comm->me == 0) {
|
||||
int size = n * sizeof(double);
|
||||
@ -825,6 +826,10 @@ void FixDeposit::restart(char *buf)
|
||||
nfirst = static_cast<int> (list[n++]);
|
||||
next_reneighbor = (bigint) ubuf(list[n++]).i;
|
||||
|
||||
bigint ntimestep_restart = (bigint) ubuf(list[n++]).i;
|
||||
if (ntimestep_restart != update->ntimestep)
|
||||
error->all(FLERR,"Must not reset timestep when restarting this fix");
|
||||
|
||||
random->reset(seed);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user