Commit 36e085e3 authored by Anders Hafreager's avatar Anders Hafreager Committed by Axel Kohlmeyer
Browse files

Fixed initialization of arrays in fixes

parent 425142ba
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -113,7 +113,8 @@ double FixTempCSVR::resamplekin(double ekin_old, double ekin_new){
/* ---------------------------------------------------------------------- */

FixTempCSVR::FixTempCSVR(LAMMPS *lmp, int narg, char **arg) :
  Fix(lmp, narg, arg)
  Fix(lmp, narg, arg),
  tstr(NULL), id_temp(NULL), random(NULL)
{
  if (narg != 7) error->all(FLERR,"Illegal fix temp/csvr command");

+2 −1
Original line number Diff line number Diff line
@@ -37,7 +37,8 @@ enum{CONSTANT,EQUAL};
/* ---------------------------------------------------------------------- */

FixTempRescale::FixTempRescale(LAMMPS *lmp, int narg, char **arg) :
  Fix(lmp, narg, arg)
  Fix(lmp, narg, arg),
  tstr(NULL), id_temp(NULL), tflag(0)
{
  if (narg < 8) error->all(FLERR,"Illegal fix temp/rescale command");

+2 −3
Original line number Diff line number Diff line
@@ -39,7 +39,8 @@ using namespace FixConst;

/* ---------------------------------------------------------------------- */

FixTMD::FixTMD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
FixTMD::FixTMD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg),
nfileevery(0), fp(NULL), xf(NULL), xold(NULL)
{
  if (narg < 6) error->all(FLERR,"Illegal fix tmd command");

@@ -54,8 +55,6 @@ FixTMD::FixTMD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg)
  // perform initial allocation of atom-based arrays
  // register with Atom class

  xf = NULL;
  xold = NULL;
  grow_arrays(atom->nmax);
  atom->add_callback(0);

+5 −3
Original line number Diff line number Diff line
@@ -37,7 +37,8 @@ enum{SCALAR,VECTOR};
/* ---------------------------------------------------------------------- */

FixVector::FixVector(LAMMPS *lmp, int narg, char **arg) :
  Fix(lmp, narg, arg)
  Fix(lmp, narg, arg),
  nvalues(0), which(NULL), argindex(NULL), value2index(NULL), ids(NULL), vector(NULL), array(NULL)
{
  if (narg < 5) error->all(FLERR,"Illegal fix vector command");

@@ -294,7 +295,7 @@ void FixVector::end_of_step()

    // evaluate equal-style or vector-style variable

    } else if (which[i] == VARIABLE)
    } else if (which[i] == VARIABLE) {
      if (argindex[i] == 0) 
        result[i] = input->variable->compute_equal(m);
      else {
@@ -305,6 +306,7 @@ void FixVector::end_of_step()
        else result[i] = varvec[index-1];
      }
    }
  }

  // trigger computes on next needed step

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

FixViscous::FixViscous(LAMMPS *lmp, int narg, char **arg) :
  Fix(lmp, narg, arg)
  Fix(lmp, narg, arg),
  gamma(NULL)
{
  if (narg < 4) error->all(FLERR,"Illegal fix viscous command");