Small correction to fix/ave/correlate/long to show the right output after a restart
This commit is contained in:
@ -503,7 +503,7 @@ void FixAveCorrelateLong::end_of_step()
|
|||||||
if (overwrite) {
|
if (overwrite) {
|
||||||
bigint fileend = platform::ftell(fp);
|
bigint fileend = platform::ftell(fp);
|
||||||
if ((fileend > 0) && (platform::ftruncate(fp,fileend)))
|
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) {
|
void FixAveCorrelateLong::write_restart(FILE *fp) {
|
||||||
if (comm->me == 0) {
|
if (comm->me == 0) {
|
||||||
int nsize = 3*npair*numcorrelators*p + 2*npair*numcorrelators
|
int nsize = 3*npair*numcorrelators*p + 2*npair*numcorrelators
|
||||||
+ numcorrelators*p + 2*numcorrelators + 6;
|
+ numcorrelators*p + 2*numcorrelators + 7;
|
||||||
int n=0;
|
int n=0;
|
||||||
double *list;
|
double *list;
|
||||||
memory->create(list,nsize,"correlator:list");
|
memory->create(list,nsize,"correlator:list");
|
||||||
@ -736,6 +736,7 @@ void FixAveCorrelateLong::write_restart(FILE *fp) {
|
|||||||
list[n++] = numcorrelators;
|
list[n++] = numcorrelators;
|
||||||
list[n++] = p;
|
list[n++] = p;
|
||||||
list[n++] = m;
|
list[n++] = m;
|
||||||
|
list[n++] = kmax;
|
||||||
list[n++] = last_accumulated_step;
|
list[n++] = last_accumulated_step;
|
||||||
for (int i=0; i < npair; i++)
|
for (int i=0; i < npair; i++)
|
||||||
for (int j=0; j < numcorrelators; j++) {
|
for (int j=0; j < numcorrelators; j++) {
|
||||||
@ -771,6 +772,7 @@ void FixAveCorrelateLong::restart(char *buf)
|
|||||||
int numcorrelatorsin = static_cast<int> (list[n++]);
|
int numcorrelatorsin = static_cast<int> (list[n++]);
|
||||||
int pin = static_cast<int>(list[n++]);
|
int pin = static_cast<int>(list[n++]);
|
||||||
int min = 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++]);
|
last_accumulated_step = static_cast<int>(list[n++]);
|
||||||
|
|
||||||
if ((npairin!=npair) || (numcorrelatorsin!=numcorrelators) || (pin!=(int)p) || (min!=(int)m))
|
if ((npairin!=npair) || (numcorrelatorsin!=numcorrelators) || (pin!=(int)p) || (min!=(int)m))
|
||||||
|
|||||||
Reference in New Issue
Block a user