forked from lijiext/lammps
git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@15633 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
parent
31e41707e0
commit
2a30b76277
|
@ -40,6 +40,7 @@ vstore(NULL), astore(NULL), rbuf(NULL)
|
|||
// 0/1 flag = not-store or store peratom values in restart file
|
||||
// nvalues = # of peratom values, N = 1 is vector, N > 1 is array
|
||||
|
||||
disable = 0;
|
||||
nvalues = vecflag = 0;
|
||||
flavor = UNKNOWN;
|
||||
|
||||
|
@ -230,6 +231,8 @@ void FixStore::grow_arrays(int nmax)
|
|||
|
||||
void FixStore::copy_arrays(int i, int j, int delflag)
|
||||
{
|
||||
if (disable) return;
|
||||
|
||||
if (vecflag) vstore[j] = vstore[i];
|
||||
else
|
||||
for (int m = 0; m < nvalues; m++)
|
||||
|
@ -242,6 +245,8 @@ void FixStore::copy_arrays(int i, int j, int delflag)
|
|||
|
||||
int FixStore::pack_exchange(int i, double *buf)
|
||||
{
|
||||
if (disable) return 0;
|
||||
|
||||
if (vecflag) buf[0] = vstore[i];
|
||||
else
|
||||
for (int m = 0; m < nvalues; m++)
|
||||
|
@ -255,6 +260,8 @@ int FixStore::pack_exchange(int i, double *buf)
|
|||
|
||||
int FixStore::unpack_exchange(int nlocal, double *buf)
|
||||
{
|
||||
if (disable) return 0;
|
||||
|
||||
if (vecflag) vstore[nlocal] = buf[0];
|
||||
else
|
||||
for (int m = 0; m < nvalues; m++)
|
||||
|
@ -268,6 +275,11 @@ int FixStore::unpack_exchange(int nlocal, double *buf)
|
|||
|
||||
int FixStore::pack_restart(int i, double *buf)
|
||||
{
|
||||
if (disable) {
|
||||
buf[0] = 0;
|
||||
return 1;
|
||||
}
|
||||
|
||||
buf[0] = nvalues+1;
|
||||
if (vecflag) buf[1] = vstore[i];
|
||||
else
|
||||
|
@ -282,6 +294,8 @@ int FixStore::pack_restart(int i, double *buf)
|
|||
|
||||
void FixStore::unpack_restart(int nlocal, int nth)
|
||||
{
|
||||
if (disable) return;
|
||||
|
||||
double **extra = atom->extra;
|
||||
|
||||
// skip to Nth set of extra values
|
||||
|
@ -302,6 +316,7 @@ void FixStore::unpack_restart(int nlocal, int nth)
|
|||
|
||||
int FixStore::maxsize_restart()
|
||||
{
|
||||
if (disable) return 1;
|
||||
return nvalues+1;
|
||||
}
|
||||
|
||||
|
@ -311,6 +326,7 @@ int FixStore::maxsize_restart()
|
|||
|
||||
int FixStore::size_restart(int nlocal)
|
||||
{
|
||||
if (disable) return 1;
|
||||
return nvalues+1;
|
||||
}
|
||||
|
||||
|
|
|
@ -31,6 +31,7 @@ class FixStore : public Fix {
|
|||
int nvalues; // number of per-atom values
|
||||
double *vstore; // vector 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();
|
||||
|
|
Loading…
Reference in New Issue