Commit 1f3ef8e0 authored by Anders Hafreager's avatar Anders Hafreager Committed by Axel Kohlmeyer
Browse files

Fixed initialization of arrays in computes

parent 3e793d6e
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -44,7 +44,8 @@ using namespace MathConst;
/* ---------------------------------------------------------------------- */

ComputeHexOrderAtom::ComputeHexOrderAtom(LAMMPS *lmp, int narg, char **arg) :
  Compute(lmp, narg, arg)
  Compute(lmp, narg, arg),
  distsq(NULL), nearest(NULL), qnarray(NULL)
{
  if (narg < 3 ) error->all(FLERR,"Illegal compute hexorder/atom command");

@@ -87,10 +88,7 @@ ComputeHexOrderAtom::ComputeHexOrderAtom(LAMMPS *lmp, int narg, char **arg) :
  size_peratom_cols = ncol;

  nmax = 0;
  qnarray = NULL;
  maxneigh = 0;
  distsq = NULL;
  nearest = NULL;
}

/* ---------------------------------------------------------------------- */
+2 −1
Original line number Diff line number Diff line
@@ -24,7 +24,8 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */

ComputeImproper::ComputeImproper(LAMMPS *lmp, int narg, char **arg) :
  Compute(lmp, narg, arg)
  Compute(lmp, narg, arg),
  emine(NULL)
{
  if (narg != 3) error->all(FLERR,"Illegal compute improper command");

+2 −3
Original line number Diff line number Diff line
@@ -35,7 +35,8 @@ using namespace MathConst;
/* ---------------------------------------------------------------------- */

ComputeImproperLocal::ComputeImproperLocal(LAMMPS *lmp, int narg, char **arg) :
  Compute(lmp, narg, arg)
  Compute(lmp, narg, arg),
  vector(NULL), array(NULL)
{
  if (narg < 4) error->all(FLERR,"Illegal compute improper/local command");

@@ -57,8 +58,6 @@ ComputeImproperLocal::ComputeImproperLocal(LAMMPS *lmp, int narg, char **arg) :
  }

  nmax = 0;
  vector = NULL;
  array = NULL;
}

/* ---------------------------------------------------------------------- */
+3 −4
Original line number Diff line number Diff line
@@ -26,7 +26,9 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */

ComputeInertiaChunk::ComputeInertiaChunk(LAMMPS *lmp, int narg, char **arg) :
  Compute(lmp, narg, arg)
  Compute(lmp, narg, arg),
  idchunk(NULL), massproc(NULL), masstotal(NULL), com(NULL), comall(NULL),
  inertia(NULL), inertiaall(NULL)
{
  if (narg != 4) error->all(FLERR,"Illegal compute inertia/chunk command");

@@ -48,9 +50,6 @@ ComputeInertiaChunk::ComputeInertiaChunk(LAMMPS *lmp, int narg, char **arg) :

  nchunk = 1;
  maxchunk = 0;
  massproc = masstotal = NULL;
  com = comall = NULL;
  inertia = inertiaall = NULL;
  allocate();
}

+2 −2
Original line number Diff line number Diff line
@@ -26,7 +26,8 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */

ComputeKEAtom::ComputeKEAtom(LAMMPS *lmp, int narg, char **arg) :
  Compute(lmp, narg, arg)
  Compute(lmp, narg, arg),
  ke(NULL)
{
  if (narg != 3) error->all(FLERR,"Illegal compute ke/atom command");

@@ -34,7 +35,6 @@ ComputeKEAtom::ComputeKEAtom(LAMMPS *lmp, int narg, char **arg) :
  size_peratom_cols = 0;

  nmax = 0;
  ke = NULL;
}

/* ---------------------------------------------------------------------- */
Loading