fix uninitialized memory access bug in memory usage computation for fix STORE

This commit is contained in:
Axel Kohlmeyer
2022-07-28 16:40:35 -04:00
parent 4d69c7aea2
commit c2d96ba911

View File

@ -391,8 +391,8 @@ int FixStore::size_restart(int /*nlocal*/)
double FixStore::memory_usage()
{
double bytes = (double) n1 * n2;
if (flavor == GLOBAL) bytes *= sizeof(double);
if (flavor == PERATOM) bytes *= atom->nmax * sizeof(double);
double bytes = 0.0;
if (flavor == GLOBAL) bytes = (double)n1*n2 * sizeof(double);
if (flavor == PERATOM) bytes = (double)atom->nmax*n2*n3 * sizeof(double);
return bytes;
}