From a294a970e3ad5c42fbf8dbd9c27cb34f07b0c4d5 Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Fri, 9 Aug 2024 14:01:41 -0600 Subject: [PATCH 1/3] ensure restart with global data resets the vector/array sizes --- src/fix_store_global.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/fix_store_global.cpp b/src/fix_store_global.cpp index 028d35810e..da0a5e0ad9 100644 --- a/src/fix_store_global.cpp +++ b/src/fix_store_global.cpp @@ -17,6 +17,9 @@ #include "error.h" #include "memory.h" +// DEBUG +#include "update.h" + #include using namespace LAMMPS_NS; @@ -152,7 +155,8 @@ 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); memory->destroy(astore); @@ -165,8 +169,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) From 7ce2919092299e4f8461467fe526876911f35d6e Mon Sep 17 00:00:00 2001 From: Steve Plimpton Date: Fri, 9 Aug 2024 14:10:15 -0600 Subject: [PATCH 2/3] removed debug info --- src/fix_store_global.cpp | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/fix_store_global.cpp b/src/fix_store_global.cpp index da0a5e0ad9..a97fca1676 100644 --- a/src/fix_store_global.cpp +++ b/src/fix_store_global.cpp @@ -17,9 +17,6 @@ #include "error.h" #include "memory.h" -// DEBUG -#include "update.h" - #include using namespace LAMMPS_NS; From 22f25f0c00c8f53c7b5a9854a6a48dbbfbb505e0 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sat, 10 Aug 2024 10:13:36 -0400 Subject: [PATCH 3/3] whitespace --- src/fix_store_global.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fix_store_global.cpp b/src/fix_store_global.cpp index a97fca1676..5baef27029 100644 --- a/src/fix_store_global.cpp +++ b/src/fix_store_global.cpp @@ -153,7 +153,7 @@ void FixStoreGlobal::restart(char *buf) // 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); memory->destroy(astore);