bug fix for per-atom vector output of fix pair
This commit is contained in:
@ -124,7 +124,7 @@ FixPair::FixPair(LAMMPS *lmp, int narg, char **arg) :
|
|||||||
|
|
||||||
int nlocal = atom->nlocal;
|
int nlocal = atom->nlocal;
|
||||||
|
|
||||||
if (ncols == 0) {
|
if (ncols == 1) {
|
||||||
for (int i = 0; i < nlocal; i++)
|
for (int i = 0; i < nlocal; i++)
|
||||||
vector[i] = 0.0;
|
vector[i] = 0.0;
|
||||||
} else {
|
} else {
|
||||||
@ -153,7 +153,7 @@ FixPair::~FixPair()
|
|||||||
delete [] triggername;
|
delete [] triggername;
|
||||||
delete [] triggerptr;
|
delete [] triggerptr;
|
||||||
|
|
||||||
if (ncols == 0) memory->destroy(vector);
|
if (ncols == 1) memory->destroy(vector);
|
||||||
else memory->destroy(array);
|
else memory->destroy(array);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -228,7 +228,7 @@ void FixPair::post_force(int /*vflag*/)
|
|||||||
|
|
||||||
if (columns == 0) {
|
if (columns == 0) {
|
||||||
double *pvector = (double *) pvoid;
|
double *pvector = (double *) pvoid;
|
||||||
if (ncols == 0) {
|
if (ncols == 1) {
|
||||||
for (int i = 0; i < nlocal; i++)
|
for (int i = 0; i < nlocal; i++)
|
||||||
vector[i] = pvector[i];
|
vector[i] = pvector[i];
|
||||||
} else {
|
} else {
|
||||||
@ -259,7 +259,7 @@ void FixPair::post_force(int /*vflag*/)
|
|||||||
|
|
||||||
void FixPair::grow_arrays(int nmax)
|
void FixPair::grow_arrays(int nmax)
|
||||||
{
|
{
|
||||||
if (ncols == 0) {
|
if (ncols == 1) {
|
||||||
memory->grow(vector,nmax,"store/state:vector");
|
memory->grow(vector,nmax,"store/state:vector");
|
||||||
vector_atom = vector;
|
vector_atom = vector;
|
||||||
} else {
|
} else {
|
||||||
@ -275,7 +275,7 @@ void FixPair::grow_arrays(int nmax)
|
|||||||
double FixPair::memory_usage()
|
double FixPair::memory_usage()
|
||||||
{
|
{
|
||||||
double bytes = 0.0;
|
double bytes = 0.0;
|
||||||
if (ncols == 0) bytes += (double)atom->nmax * sizeof(double);
|
if (ncols == 1) bytes += (double)atom->nmax * sizeof(double);
|
||||||
else bytes += (double)atom->nmax*ncols * sizeof(double);
|
else bytes += (double)atom->nmax*ncols * sizeof(double);
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user