Small correction to fix/ave/correlate/long to show the right output after a restart

This commit is contained in:
Jorge Ramirez
2024-01-07 18:38:47 +01:00
parent 1e9eb933be
commit 1b6dc1fe8c

View File

@ -503,7 +503,7 @@ void FixAveCorrelateLong::end_of_step()
if (overwrite) {
bigint fileend = platform::ftell(fp);
if ((fileend > 0) && (platform::ftruncate(fp,fileend)))
error->warning(FLERR,"Error while tuncating output: {}", utils::getsyserror());
error->warning(FLERR,"Error while truncating output: {}", utils::getsyserror());
}
}
}
@ -728,7 +728,7 @@ double FixAveCorrelateLong::memory_usage() {
void FixAveCorrelateLong::write_restart(FILE *fp) {
if (comm->me == 0) {
int nsize = 3*npair*numcorrelators*p + 2*npair*numcorrelators
+ numcorrelators*p + 2*numcorrelators + 6;
+ numcorrelators*p + 2*numcorrelators + 7;
int n=0;
double *list;
memory->create(list,nsize,"correlator:list");
@ -736,6 +736,7 @@ void FixAveCorrelateLong::write_restart(FILE *fp) {
list[n++] = numcorrelators;
list[n++] = p;
list[n++] = m;
list[n++] = kmax;
list[n++] = last_accumulated_step;
for (int i=0; i < npair; i++)
for (int j=0; j < numcorrelators; j++) {
@ -771,6 +772,7 @@ void FixAveCorrelateLong::restart(char *buf)
int numcorrelatorsin = static_cast<int> (list[n++]);
int pin = static_cast<int>(list[n++]);
int min = static_cast<int>(list[n++]);
kmax = static_cast<int>(list[n++]);
last_accumulated_step = static_cast<int>(list[n++]);
if ((npairin!=npair) || (numcorrelatorsin!=numcorrelators) || (pin!=(int)p) || (min!=(int)m))