Merge pull request #1404 from akohlmey/compute-local-bugfix

Fix bug reported in Issue #1401
This commit is contained in:
Axel Kohlmeyer 2019-04-05 15:34:10 -04:00 committed by GitHub
commit 7f040a3676
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 11 deletions

View File

@ -39,8 +39,6 @@ ComputeBodyLocal::ComputeBodyLocal(LAMMPS *lmp, int narg, char **arg) :
local_flag = 1;
nvalues = narg - 3;
if (nvalues == 1) size_local_cols = 0;
else size_local_cols = nvalues;
which = new int[nvalues];
index = new int[nvalues];
@ -66,6 +64,9 @@ ComputeBodyLocal::ComputeBodyLocal(LAMMPS *lmp, int narg, char **arg) :
error->all(FLERR,"Invalid index in compute body/local command");
}
if (nvalues == 1) size_local_cols = 0;
else size_local_cols = nvalues;
nmax = 0;
vector = NULL;
array = NULL;

View File

@ -40,8 +40,6 @@ ComputeRigidLocal::ComputeRigidLocal(LAMMPS *lmp, int narg, char **arg) :
local_flag = 1;
nvalues = narg - 4;
if (nvalues == 1) size_local_cols = 0;
else size_local_cols = nvalues;
int n = strlen(arg[3]) + 1;
idrigid = new char[n];
@ -88,7 +86,10 @@ ComputeRigidLocal::ComputeRigidLocal(LAMMPS *lmp, int narg, char **arg) :
else error->all(FLERR,"Invalid keyword in compute rigid/local command");
}
ncount = nmax = 0;
if (nvalues == 1) size_local_cols = 0;
else size_local_cols = nvalues;
ncount = nmax = 0;
vlocal = NULL;
alocal = NULL;
}

View File

@ -46,9 +46,6 @@ ComputeImproperLocal::ComputeImproperLocal(LAMMPS *lmp, int narg, char **arg) :
local_flag = 1;
nvalues = narg - 3;
if (nvalues == 1) size_local_cols = 0;
else size_local_cols = nvalues;
cflag = -1;
nvalues = 0;
@ -57,6 +54,9 @@ ComputeImproperLocal::ComputeImproperLocal(LAMMPS *lmp, int narg, char **arg) :
else error->all(FLERR,"Invalid keyword in compute improper/local command");
}
if (nvalues == 1) size_local_cols = 0;
else size_local_cols = nvalues;
nmax = 0;
vlocal = NULL;
alocal = NULL;

View File

@ -43,9 +43,6 @@ ComputePairLocal::ComputePairLocal(LAMMPS *lmp, int narg, char **arg) :
local_flag = 1;
nvalues = narg - 3;
if (nvalues == 1) size_local_cols = 0;
else size_local_cols = nvalues;
pstyle = new int[nvalues];
pindex = new int[nvalues];
@ -96,6 +93,9 @@ ComputePairLocal::ComputePairLocal(LAMMPS *lmp, int narg, char **arg) :
for (int i = 0; i < nvalues; i++)
if (pstyle[i] != DIST) singleflag = 1;
if (nvalues == 1) size_local_cols = 0;
else size_local_cols = nvalues;
nmax = 0;
vlocal = NULL;
alocal = NULL;