Merge pull request #4270 from lammps/fix-store-global-bug-fix

Fix a bug when restarting with stored data in fix STORE/GLOBAL for global vectors or arrays
This commit is contained in:
Axel Kohlmeyer
2024-08-10 11:29:06 -04:00
committed by GitHub

View File

@ -152,6 +152,7 @@ void FixStoreGlobal::restart(char *buf)
// means the restart file is setting size of vec or array and doing init
// because caller did not know size at time this fix was instantiated
// reallocate vstore or astore accordingly
// also reset nrow,ncol to values from restart file
if (n1 != n1_restart || n2 != n2_restart) {
memory->destroy(vstore);
@ -165,8 +166,8 @@ void FixStoreGlobal::restart(char *buf)
vecflag = 1;
else
arrayflag = 1;
n1 = n1_restart;
n2 = n2_restart;
nrow = n1 = n1_restart;
ncol = n2 = n2_restart;
if (vecflag)
memory->create(vstore, n1, "fix/store:vstore");
else if (arrayflag)