Skip to content
Snippets Groups Projects
Commit 2a30b762 authored by sjplimp's avatar sjplimp
Browse files

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@15633 f3b2605a-c512-4ea7-a41b-209d697bcdaa
parent 31e41707
No related branches found
No related tags found
No related merge requests found
...@@ -40,6 +40,7 @@ vstore(NULL), astore(NULL), rbuf(NULL) ...@@ -40,6 +40,7 @@ vstore(NULL), astore(NULL), rbuf(NULL)
// 0/1 flag = not-store or store peratom values in restart file // 0/1 flag = not-store or store peratom values in restart file
// nvalues = # of peratom values, N = 1 is vector, N > 1 is array // nvalues = # of peratom values, N = 1 is vector, N > 1 is array
disable = 0;
nvalues = vecflag = 0; nvalues = vecflag = 0;
flavor = UNKNOWN; flavor = UNKNOWN;
...@@ -230,6 +231,8 @@ void FixStore::grow_arrays(int nmax) ...@@ -230,6 +231,8 @@ void FixStore::grow_arrays(int nmax)
void FixStore::copy_arrays(int i, int j, int delflag) void FixStore::copy_arrays(int i, int j, int delflag)
{ {
if (disable) return;
if (vecflag) vstore[j] = vstore[i]; if (vecflag) vstore[j] = vstore[i];
else else
for (int m = 0; m < nvalues; m++) for (int m = 0; m < nvalues; m++)
...@@ -242,6 +245,8 @@ void FixStore::copy_arrays(int i, int j, int delflag) ...@@ -242,6 +245,8 @@ void FixStore::copy_arrays(int i, int j, int delflag)
int FixStore::pack_exchange(int i, double *buf) int FixStore::pack_exchange(int i, double *buf)
{ {
if (disable) return 0;
if (vecflag) buf[0] = vstore[i]; if (vecflag) buf[0] = vstore[i];
else else
for (int m = 0; m < nvalues; m++) for (int m = 0; m < nvalues; m++)
...@@ -255,6 +260,8 @@ int FixStore::pack_exchange(int i, double *buf) ...@@ -255,6 +260,8 @@ int FixStore::pack_exchange(int i, double *buf)
int FixStore::unpack_exchange(int nlocal, double *buf) int FixStore::unpack_exchange(int nlocal, double *buf)
{ {
if (disable) return 0;
if (vecflag) vstore[nlocal] = buf[0]; if (vecflag) vstore[nlocal] = buf[0];
else else
for (int m = 0; m < nvalues; m++) for (int m = 0; m < nvalues; m++)
...@@ -268,6 +275,11 @@ int FixStore::unpack_exchange(int nlocal, double *buf) ...@@ -268,6 +275,11 @@ int FixStore::unpack_exchange(int nlocal, double *buf)
int FixStore::pack_restart(int i, double *buf) int FixStore::pack_restart(int i, double *buf)
{ {
if (disable) {
buf[0] = 0;
return 1;
}
buf[0] = nvalues+1; buf[0] = nvalues+1;
if (vecflag) buf[1] = vstore[i]; if (vecflag) buf[1] = vstore[i];
else else
...@@ -282,6 +294,8 @@ int FixStore::pack_restart(int i, double *buf) ...@@ -282,6 +294,8 @@ int FixStore::pack_restart(int i, double *buf)
void FixStore::unpack_restart(int nlocal, int nth) void FixStore::unpack_restart(int nlocal, int nth)
{ {
if (disable) return;
double **extra = atom->extra; double **extra = atom->extra;
// skip to Nth set of extra values // skip to Nth set of extra values
...@@ -302,6 +316,7 @@ void FixStore::unpack_restart(int nlocal, int nth) ...@@ -302,6 +316,7 @@ void FixStore::unpack_restart(int nlocal, int nth)
int FixStore::maxsize_restart() int FixStore::maxsize_restart()
{ {
if (disable) return 1;
return nvalues+1; return nvalues+1;
} }
...@@ -311,6 +326,7 @@ int FixStore::maxsize_restart() ...@@ -311,6 +326,7 @@ int FixStore::maxsize_restart()
int FixStore::size_restart(int nlocal) int FixStore::size_restart(int nlocal)
{ {
if (disable) return 1;
return nvalues+1; return nvalues+1;
} }
......
...@@ -31,6 +31,7 @@ class FixStore : public Fix { ...@@ -31,6 +31,7 @@ class FixStore : public Fix {
int nvalues; // number of per-atom values int nvalues; // number of per-atom values
double *vstore; // vector storage for GLOBAL or PERATOM double *vstore; // vector storage for GLOBAL or PERATOM
double **astore; // array storage for GLOBAL or PERATOM double **astore; // array storage for GLOBAL or PERATOM
int disable; // 1 if operations (except grow) are currently disabled
FixStore(class LAMMPS *, int, char **); FixStore(class LAMMPS *, int, char **);
~FixStore(); ~FixStore();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment