Commit 3e793d6e authored by Anders Hafreager's avatar Anders Hafreager Committed by Axel Kohlmeyer
Browse files

Fixed initialization of arrays in computes

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

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

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

ComputeDihedralLocal::ComputeDihedralLocal(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 dihedral/local command");

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

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

/* ---------------------------------------------------------------------- */
+3 −5
Original line number Diff line number Diff line
@@ -30,7 +30,9 @@ enum { MASSCENTER, GEOMCENTER };
/* ---------------------------------------------------------------------- */

ComputeDipoleChunk::ComputeDipoleChunk(LAMMPS *lmp, int narg, char **arg) : 
  Compute(lmp, narg, arg)
  Compute(lmp, narg, arg),
  idchunk(NULL), massproc(NULL), masstotal(NULL), chrgproc(NULL), chrgtotal(NULL), com(NULL),
  comall(NULL), dipole(NULL), dipoleall(NULL)
{
  if ((narg != 4) && (narg != 5)) error->all(FLERR,"Illegal compute dipole/chunk command");

@@ -60,10 +62,6 @@ ComputeDipoleChunk::ComputeDipoleChunk(LAMMPS *lmp, int narg, char **arg) :

  nchunk = 1;
  maxchunk = 0;
  massproc = masstotal = NULL;
  chrgproc = chrgtotal = NULL;
  com = comall = NULL;
  dipole = dipoleall = NULL;
  allocate();
}

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

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

@@ -76,7 +77,6 @@ ComputeDisplaceAtom::ComputeDisplaceAtom(LAMMPS *lmp, int narg, char **arg) :
  // per-atom displacement array

  nmax = 0;
  displace = NULL;
}

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

ComputeErotateSphereAtom::
ComputeErotateSphereAtom(LAMMPS *lmp, int narg, char **arg) :
  Compute(lmp, narg, arg)
  Compute(lmp, narg, arg),
  erot(NULL)
{
  if (narg != 3)
    error->all(FLERR,"Illegal compute erotate/sphere//atom command");
@@ -43,7 +44,6 @@ ComputeErotateSphereAtom(LAMMPS *lmp, int narg, char **arg) :
    error->all(FLERR,"Compute erotate/sphere/atom requires atom style sphere");

  nmax = 0;
  erot = NULL;
}

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