Commit 7d43f349 authored by Anders Hafreager's avatar Anders Hafreager Committed by Axel Kohlmeyer
Browse files

Fixed initialization of arrays in computes

parent 5e811f16
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -41,7 +41,7 @@ int Compute::instance_total = 0;
Compute::Compute(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp),
Compute::Compute(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp),
  id(NULL), style(NULL),
  id(NULL), style(NULL),
  vector(NULL), array(NULL), vector_atom(NULL), array_atom(NULL), vector_local(NULL), array_local(NULL),
  vector(NULL), array(NULL), vector_atom(NULL), array_atom(NULL), vector_local(NULL), array_local(NULL),
  tlist(NULL)
  tlist(NULL), vbiasall(NULL)
{
{
  instance_me = instance_total++;
  instance_me = instance_total++;
  
  
+2 −2
Original line number Original line Diff line number Diff line
@@ -36,7 +36,8 @@ enum{NOBIAS,BIAS};
/* ---------------------------------------------------------------------- */
/* ---------------------------------------------------------------------- */


ComputeStressAtom::ComputeStressAtom(LAMMPS *lmp, int narg, char **arg) :
ComputeStressAtom::ComputeStressAtom(LAMMPS *lmp, int narg, char **arg) :
  Compute(lmp, narg, arg)
  Compute(lmp, narg, arg),
  id_temp(NULL), stress(NULL)
{
{
  if (narg < 4) error->all(FLERR,"Illegal compute stress/atom command");
  if (narg < 4) error->all(FLERR,"Illegal compute stress/atom command");


@@ -98,7 +99,6 @@ ComputeStressAtom::ComputeStressAtom(LAMMPS *lmp, int narg, char **arg) :
  }
  }


  nmax = 0;
  nmax = 0;
  stress = NULL;
}
}


/* ---------------------------------------------------------------------- */
/* ---------------------------------------------------------------------- */
+4 −7
Original line number Original line Diff line number Diff line
@@ -29,7 +29,9 @@ enum{TEMP,KECOM,INTERNAL};
/* ---------------------------------------------------------------------- */
/* ---------------------------------------------------------------------- */


ComputeTempChunk::ComputeTempChunk(LAMMPS *lmp, int narg, char **arg) :
ComputeTempChunk::ComputeTempChunk(LAMMPS *lmp, int narg, char **arg) :
  Compute(lmp, narg, arg)
  Compute(lmp, narg, arg),
  which(NULL), idchunk(NULL), id_bias(NULL), sum(NULL), sumall(NULL), count(NULL), 
  countall(NULL), massproc(NULL), masstotal(NULL), vcm(NULL), vcmall(NULL)
{
{
  if (narg < 4) error->all(FLERR,"Illegal compute temp/chunk command");
  if (narg < 4) error->all(FLERR,"Illegal compute temp/chunk command");


@@ -129,11 +131,6 @@ ComputeTempChunk::ComputeTempChunk(LAMMPS *lmp, int narg, char **arg) :


  nchunk = 1;
  nchunk = 1;
  maxchunk = 0;
  maxchunk = 0;
  sum = sumall = NULL;
  count = countall = NULL;
  massproc = masstotal = NULL;
  vcm = vcmall = NULL;
  array = NULL;
  
  
  if (nvalues)  {
  if (nvalues)  {
    array_flag = 1;
    array_flag = 1;
+2 −2
Original line number Original line Diff line number Diff line
@@ -31,7 +31,8 @@ enum{TENSOR,BIN};
/* ---------------------------------------------------------------------- */
/* ---------------------------------------------------------------------- */


ComputeTempProfile::ComputeTempProfile(LAMMPS *lmp, int narg, char **arg) :
ComputeTempProfile::ComputeTempProfile(LAMMPS *lmp, int narg, char **arg) :
  Compute(lmp, narg, arg)
  Compute(lmp, narg, arg),
  bin(NULL), vbin(NULL), binave(NULL), tbin(NULL), tbinall(NULL)
{
{
  if (narg < 7) error->all(FLERR,"Illegal compute temp/profile command");
  if (narg < 7) error->all(FLERR,"Illegal compute temp/profile command");


@@ -138,7 +139,6 @@ ComputeTempProfile::ComputeTempProfile(LAMMPS *lmp, int narg, char **arg) :
  }
  }


  maxatom = 0;
  maxatom = 0;
  bin = NULL;
}
}


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


ComputeTempRegion::ComputeTempRegion(LAMMPS *lmp, int narg, char **arg) :
ComputeTempRegion::ComputeTempRegion(LAMMPS *lmp, int narg, char **arg) :
  Compute(lmp, narg, arg)
  Compute(lmp, narg, arg),
  idregion(NULL)
{
{
  if (narg != 4) error->all(FLERR,"Illegal compute temp/region command");
  if (narg != 4) error->all(FLERR,"Illegal compute temp/region command");


Loading