Fixed initialization of arrays in computes

This commit is contained in:
Anders Hafreager 2016-08-24 16:06:58 +02:00 committed by Axel Kohlmeyer
parent d09a85733b
commit 95dde5c041
4 changed files with 8 additions and 12 deletions

View File

@ -42,7 +42,8 @@ enum{NCOMMON,NBOND,MAXBOND,MINBOND};
/* ---------------------------------------------------------------------- */
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");
@ -54,9 +55,6 @@ ComputeCNAAtom::ComputeCNAAtom(LAMMPS *lmp, int narg, char **arg) :
cutsq = cutoff*cutoff;
nmax = 0;
nearest = NULL;
nnearest = NULL;
pattern = NULL;
}
/* ---------------------------------------------------------------------- */

View File

@ -28,7 +28,8 @@ enum{ONCE,NFREQ,EVERY};
/* ---------------------------------------------------------------------- */
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");
@ -50,8 +51,6 @@ ComputeCOMChunk::ComputeCOMChunk(LAMMPS *lmp, int narg, char **arg) :
nchunk = 1;
maxchunk = 0;
massproc = masstotal = NULL;
com = comall = NULL;
allocate();
firstflag = massneed = 1;

View File

@ -32,7 +32,8 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
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");
@ -41,7 +42,6 @@ ComputeContactAtom::ComputeContactAtom(LAMMPS *lmp, int narg, char **arg) :
comm_reverse = 1;
nmax = 0;
contact = NULL;
// error checks

View File

@ -32,7 +32,8 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
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");
@ -65,8 +66,6 @@ ComputeCoordAtom::ComputeCoordAtom(LAMMPS *lmp, int narg, char **arg) :
else size_peratom_cols = ncol;
nmax = 0;
cvec = NULL;
carray = NULL;
}
/* ---------------------------------------------------------------------- */