forked from lijiext/lammps
Fixed initialization of arrays in computes
This commit is contained in:
parent
fcd54f02e6
commit
5e811f16e8
|
@ -32,7 +32,8 @@ using namespace LAMMPS_NS;
|
|||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
ComputePropertyAtom::ComputePropertyAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||
Compute(lmp, narg, arg)
|
||||
Compute(lmp, narg, arg),
|
||||
index(NULL), vector(NULL), array(NULL), pack_choice(NULL)
|
||||
{
|
||||
if (narg < 4) error->all(FLERR,"Illegal compute property/atom command");
|
||||
|
||||
|
@ -352,8 +353,6 @@ ComputePropertyAtom::ComputePropertyAtom(LAMMPS *lmp, int narg, char **arg) :
|
|||
}
|
||||
|
||||
nmax = 0;
|
||||
vector = NULL;
|
||||
array = NULL;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
|
|
@ -25,7 +25,8 @@ using namespace LAMMPS_NS;
|
|||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
ComputePropertyChunk::ComputePropertyChunk(LAMMPS *lmp, int narg, char **arg) :
|
||||
Compute(lmp, narg, arg)
|
||||
Compute(lmp, narg, arg),
|
||||
idchunk(NULL), count_one(NULL), count_all(NULL)
|
||||
{
|
||||
if (narg < 5) error->all(FLERR,"Illegal compute property/chunk command");
|
||||
|
||||
|
@ -78,9 +79,6 @@ ComputePropertyChunk::ComputePropertyChunk(LAMMPS *lmp, int narg, char **arg) :
|
|||
|
||||
nchunk = 1;
|
||||
maxchunk = 0;
|
||||
vector = NULL;
|
||||
array = NULL;
|
||||
count_one = count_all = NULL;
|
||||
allocate();
|
||||
|
||||
if (nvalues == 1) {
|
||||
|
|
|
@ -34,7 +34,8 @@ enum{TYPE,RADIUS};
|
|||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
ComputePropertyLocal::ComputePropertyLocal(LAMMPS *lmp, int narg, char **arg) :
|
||||
Compute(lmp, narg, arg)
|
||||
Compute(lmp, narg, arg),
|
||||
vector(NULL), array(NULL), indices(NULL), pack_choice(NULL)
|
||||
{
|
||||
if (narg < 4) error->all(FLERR,"Illegal compute property/local command");
|
||||
|
||||
|
@ -253,9 +254,6 @@ ComputePropertyLocal::ComputePropertyLocal(LAMMPS *lmp, int narg, char **arg) :
|
|||
error->all(FLERR,"Compute property/local requires atom attribute radius");
|
||||
|
||||
nmax = 0;
|
||||
vector = NULL;
|
||||
array = NULL;
|
||||
indices = NULL;
|
||||
}
|
||||
|
||||
/* ---------------------------------------------------------------------- */
|
||||
|
|
|
@ -38,7 +38,9 @@ using namespace MathConst;
|
|||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
ComputeRDF::ComputeRDF(LAMMPS *lmp, int narg, char **arg) :
|
||||
Compute(lmp, narg, arg)
|
||||
Compute(lmp, narg, arg),
|
||||
rdfpair(NULL), nrdfpair(NULL), ilo(NULL), ihi(NULL), jlo(NULL), jhi(NULL),
|
||||
hist(NULL), histall(NULL), typecount(NULL), icount(NULL), jcount(NULL), duplicates(NULL)
|
||||
{
|
||||
if (narg < 4 || (narg-4) % 2) error->all(FLERR,"Illegal compute rdf command");
|
||||
|
||||
|
|
|
@ -43,7 +43,9 @@ enum{PERATOM,LOCAL};
|
|||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) :
|
||||
Compute(lmp, narg, arg)
|
||||
Compute(lmp, narg, arg),
|
||||
nvalues(0), which(NULL), argindex(NULL), flavor(NULL), value2index(NULL), ids(NULL),
|
||||
onevec(NULL), replace(NULL), indices(NULL), owner(NULL), idregion(NULL), varatom(NULL)
|
||||
{
|
||||
int iarg = 0;
|
||||
if (strcmp(style,"reduce") == 0) {
|
||||
|
|
|
@ -34,7 +34,8 @@ enum{COMPUTE,FIX,VARIABLE};
|
|||
/* ---------------------------------------------------------------------- */
|
||||
|
||||
ComputeSlice::ComputeSlice(LAMMPS *lmp, int narg, char **arg) :
|
||||
Compute(lmp, narg, arg)
|
||||
Compute(lmp, narg, arg),
|
||||
nvalues(0), which(NULL), argindex(NULL), value2index(NULL), ids(NULL)
|
||||
{
|
||||
if (narg < 7) error->all(FLERR,"Illegal compute slice command");
|
||||
|
||||
|
|
Loading…
Reference in New Issue