ensure restart with global data resets the vector/array sizes
This commit is contained in:
@ -17,6 +17,9 @@
|
|||||||
#include "error.h"
|
#include "error.h"
|
||||||
#include "memory.h"
|
#include "memory.h"
|
||||||
|
|
||||||
|
// DEBUG
|
||||||
|
#include "update.h"
|
||||||
|
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
using namespace LAMMPS_NS;
|
using namespace LAMMPS_NS;
|
||||||
@ -152,6 +155,7 @@ void FixStoreGlobal::restart(char *buf)
|
|||||||
// means the restart file is setting size of vec or array and doing init
|
// 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
|
// because caller did not know size at time this fix was instantiated
|
||||||
// reallocate vstore or astore accordingly
|
// reallocate vstore or astore accordingly
|
||||||
|
// also reset nrow,ncol to values from restart file
|
||||||
|
|
||||||
if (n1 != n1_restart || n2 != n2_restart) {
|
if (n1 != n1_restart || n2 != n2_restart) {
|
||||||
memory->destroy(vstore);
|
memory->destroy(vstore);
|
||||||
@ -165,8 +169,8 @@ void FixStoreGlobal::restart(char *buf)
|
|||||||
vecflag = 1;
|
vecflag = 1;
|
||||||
else
|
else
|
||||||
arrayflag = 1;
|
arrayflag = 1;
|
||||||
n1 = n1_restart;
|
nrow = n1 = n1_restart;
|
||||||
n2 = n2_restart;
|
ncol = n2 = n2_restart;
|
||||||
if (vecflag)
|
if (vecflag)
|
||||||
memory->create(vstore, n1, "fix/store:vstore");
|
memory->create(vstore, n1, "fix/store:vstore");
|
||||||
else if (arrayflag)
|
else if (arrayflag)
|
||||||
|
|||||||
Reference in New Issue
Block a user