forked from lijiext/lammps
Fixed initialization of arrays in computes
This commit is contained in:
parent
d09a85733b
commit
95dde5c041
|
@ -42,7 +42,8 @@ enum{NCOMMON,NBOND,MAXBOND,MINBOND};
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
ComputeCNAAtom::ComputeCNAAtom(LAMMPS *lmp, int narg, char **arg) :
|
ComputeCNAAtom::ComputeCNAAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||||
Compute(lmp, narg, arg)
|
Compute(lmp, narg, arg),
|
||||||
|
nearest(NULL), nnearest(NULL), pattern(NULL)
|
||||||
{
|
{
|
||||||
if (narg != 4) error->all(FLERR,"Illegal compute cna/atom command");
|
if (narg != 4) error->all(FLERR,"Illegal compute cna/atom command");
|
||||||
|
|
||||||
|
@ -54,9 +55,6 @@ ComputeCNAAtom::ComputeCNAAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||||
cutsq = cutoff*cutoff;
|
cutsq = cutoff*cutoff;
|
||||||
|
|
||||||
nmax = 0;
|
nmax = 0;
|
||||||
nearest = NULL;
|
|
||||||
nnearest = NULL;
|
|
||||||
pattern = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
|
@ -28,7 +28,8 @@ enum{ONCE,NFREQ,EVERY};
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
ComputeCOMChunk::ComputeCOMChunk(LAMMPS *lmp, int narg, char **arg) :
|
ComputeCOMChunk::ComputeCOMChunk(LAMMPS *lmp, int narg, char **arg) :
|
||||||
Compute(lmp, narg, arg)
|
Compute(lmp, narg, arg),
|
||||||
|
idchunk(NULL), masstotal(NULL), massproc(NULL), com(NULL), comall(NULL)
|
||||||
{
|
{
|
||||||
if (narg != 4) error->all(FLERR,"Illegal compute com/chunk command");
|
if (narg != 4) error->all(FLERR,"Illegal compute com/chunk command");
|
||||||
|
|
||||||
|
@ -50,8 +51,6 @@ ComputeCOMChunk::ComputeCOMChunk(LAMMPS *lmp, int narg, char **arg) :
|
||||||
|
|
||||||
nchunk = 1;
|
nchunk = 1;
|
||||||
maxchunk = 0;
|
maxchunk = 0;
|
||||||
massproc = masstotal = NULL;
|
|
||||||
com = comall = NULL;
|
|
||||||
allocate();
|
allocate();
|
||||||
|
|
||||||
firstflag = massneed = 1;
|
firstflag = massneed = 1;
|
||||||
|
|
|
@ -32,7 +32,8 @@ using namespace LAMMPS_NS;
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
ComputeContactAtom::ComputeContactAtom(LAMMPS *lmp, int narg, char **arg) :
|
ComputeContactAtom::ComputeContactAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||||
Compute(lmp, narg, arg)
|
Compute(lmp, narg, arg),
|
||||||
|
contact(NULL)
|
||||||
{
|
{
|
||||||
if (narg != 3) error->all(FLERR,"Illegal compute contact/atom command");
|
if (narg != 3) error->all(FLERR,"Illegal compute contact/atom command");
|
||||||
|
|
||||||
|
@ -41,7 +42,6 @@ ComputeContactAtom::ComputeContactAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||||
comm_reverse = 1;
|
comm_reverse = 1;
|
||||||
|
|
||||||
nmax = 0;
|
nmax = 0;
|
||||||
contact = NULL;
|
|
||||||
|
|
||||||
// error checks
|
// error checks
|
||||||
|
|
||||||
|
|
|
@ -32,7 +32,8 @@ using namespace LAMMPS_NS;
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
||||||
ComputeCoordAtom::ComputeCoordAtom(LAMMPS *lmp, int narg, char **arg) :
|
ComputeCoordAtom::ComputeCoordAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||||
Compute(lmp, narg, arg)
|
Compute(lmp, narg, arg),
|
||||||
|
typelo(NULL), typehi(NULL), cvec(NULL), carray(NULL)
|
||||||
{
|
{
|
||||||
if (narg < 4) error->all(FLERR,"Illegal compute coord/atom command");
|
if (narg < 4) error->all(FLERR,"Illegal compute coord/atom command");
|
||||||
|
|
||||||
|
@ -65,8 +66,6 @@ ComputeCoordAtom::ComputeCoordAtom(LAMMPS *lmp, int narg, char **arg) :
|
||||||
else size_peratom_cols = ncol;
|
else size_peratom_cols = ncol;
|
||||||
|
|
||||||
nmax = 0;
|
nmax = 0;
|
||||||
cvec = NULL;
|
|
||||||
carray = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ---------------------------------------------------------------------- */
|
/* ---------------------------------------------------------------------- */
|
||||||
|
|
Loading…
Reference in New Issue