cleanup and bugfix

This commit is contained in:
Axel Kohlmeyer 2020-08-09 15:12:38 -04:00
parent 2fcd7b79ab
commit b223ca1436
No known key found for this signature in database
GPG Key ID: D9B44E93BF0C375A
2 changed files with 5 additions and 7 deletions

View File

@ -328,18 +328,16 @@ void FixTempCSLD::write_restart(FILE *fp)
void FixTempCSLD::restart(char *buf)
{
int n = 0;
double *list = (double *) buf;
energy = list[n++];
int nprocs = (int) list[n++];
energy = list[0];
int nprocs = (int) list[1];
if (nprocs != comm->nprocs) {
if (comm->me == 0)
error->warning(FLERR,"Different number of procs. Cannot restore RNG state.");
} else random->set_state(list+n+comm->me*103);
} else random->set_state(list+2+comm->me*103);
}
/* ----------------------------------------------------------------------
extract thermostat properties
------------------------------------------------------------------------- */

View File

@ -126,6 +126,7 @@ FixTempCSVR::FixTempCSVR(LAMMPS *lmp, int narg, char **arg) :
// CSVR thermostat should be applied every step
restart_global = 1;
nevery = 1;
scalar_flag = 1;
global_freq = nevery;
@ -360,7 +361,6 @@ void FixTempCSVR::write_restart(FILE *fp)
void FixTempCSVR::restart(char *buf)
{
int n = 0;
double *list = (double *) buf;
energy = list[0];
@ -368,7 +368,7 @@ void FixTempCSVR::restart(char *buf)
if (nprocs != comm->nprocs) {
if (comm->me == 0)
error->warning(FLERR,"Different number of procs. Cannot restore RNG state.");
} else random->set_state(list+n+comm->me*103);
} else random->set_state(list+2+comm->me*103);
}
/* ----------------------------------------------------------------------