From 1b6dc1fe8cf1e7063f73fd4544f68f45f7075791 Mon Sep 17 00:00:00 2001 From: Jorge Ramirez Date: Sun, 7 Jan 2024 18:38:47 +0100 Subject: [PATCH] Small correction to fix/ave/correlate/long to show the right output after a restart --- src/EXTRA-FIX/fix_ave_correlate_long.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/EXTRA-FIX/fix_ave_correlate_long.cpp b/src/EXTRA-FIX/fix_ave_correlate_long.cpp index 7fa57af343..fc1760b353 100644 --- a/src/EXTRA-FIX/fix_ave_correlate_long.cpp +++ b/src/EXTRA-FIX/fix_ave_correlate_long.cpp @@ -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 (list[n++]); int pin = static_cast(list[n++]); int min = static_cast(list[n++]); + kmax = static_cast(list[n++]); last_accumulated_step = static_cast(list[n++]); if ((npairin!=npair) || (numcorrelatorsin!=numcorrelators) || (pin!=(int)p) || (min!=(int)m))