mirror of https://github.com/lammps/lammps.git
fix wrong column size assignment bug when using optional arguments in some local computes
This commit is contained in:
parent
f73ccc3025
commit
8820467a8b
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue