Commit 9c376006 authored by Jun-Chieh Wang's avatar Jun-Chieh Wang
Browse files

move it to the constructor

parent 3bc2a550
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -193,6 +193,14 @@ FixDeposit::FixDeposit(LAMMPS *lmp, int narg, char **arg) :
  next_reneighbor = update->ntimestep + 1;
  nfirst = next_reneighbor;
  ninserted = 0;

  // throw away the first few numbers to avoid the unexpected correlations 

  double tmp_rand;
  for (int ii=0; ii < 30; ii++) {
    tmp_rand = random->uniform();      
  }

}

/* ---------------------------------------------------------------------- */
@@ -343,11 +351,6 @@ void FixDeposit::pre_exchange()

    // choose random position for new particle within region
    if (distflag == DIST_UNIFORM) {
      // throw away the first few numbers to avoid the unexpected correlations 
      double tmp_rand;
      for (int ii=0; ii < 30; ii++) {
        tmp_rand = random->uniform();      
      }
      do {
        coord[0] = xlo + random->uniform() * (xhi-xlo);
        coord[1] = ylo + random->uniform() * (yhi-ylo);