Commit 5e811f16 authored by Anders Hafreager's avatar Anders Hafreager Committed by Axel Kohlmeyer
Browse files

Fixed initialization of arrays in computes

parent fcd54f02
Loading
Loading
Loading
Loading
+2 −3
Original line number Diff line number Diff line
@@ -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;
}

/* ---------------------------------------------------------------------- */
+2 −4
Original line number Diff line number Diff line
@@ -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) {
+2 −4
Original line number Diff line number Diff line
@@ -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;
}

/* ---------------------------------------------------------------------- */
+3 −1
Original line number Diff line number Diff line
@@ -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");

+3 −1
Original line number Diff line number Diff line
@@ -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) {
Loading