Commit aa1d0f3d authored by jrgissing's avatar jrgissing
Browse files

actually fulfill promise given by 'ninsert == 0' warning

parent c4991778
Loading
Loading
Loading
Loading
+79 −82
Original line number Diff line number Diff line
@@ -202,7 +202,12 @@ void CreateAtoms::command(int narg, char **arg)
      if (iarg+3 > narg) error->all(FLERR,"Illegal create_atoms command");
      ninsert = force->inumeric(FLERR,arg[iarg+1]);
      insertseed = force->inumeric(FLERR,arg[iarg+2]);
      insertflag = 1;
      if (ninsert > 0) insertflag = 1;
      else {
        if (me == 0) error->warning(FLERR,"Specifying an 'insert' value of "
                                 "'0' is equivalent to no 'insert' keyword");
        insertflag = 0;
      }
      iarg += 3;
    } else error->all(FLERR,"Illegal create_atoms command");
  }
@@ -823,12 +828,6 @@ void CreateAtoms::add_lattice()

void CreateAtoms::lattice_mask()
{
  if (ninsert == 0 && insertflag && me == 0) {
    error->warning(FLERR,"Specifying an 'insert' value of '0' is equivalent to no 'insert' keyword");
    ninsert = nlattpts;
  }

  if (ninsert > 0) {
  int nboxme;
  if (nprocs > 1) {
    int *allnlattpts = new int[nprocs]();
@@ -846,7 +845,6 @@ void CreateAtoms::lattice_mask()
        cumsum_lattpts[i] = total_lattpts;
      }


     if (ninsert > total_lattpts)
        error->one(FLERR,"Attempting to insert more particles than available lattice points");

@@ -918,7 +916,6 @@ void CreateAtoms::lattice_mask()
    }
  }
}
}

/* ----------------------------------------------------------------------
   add a randomly rotated molecule with its center at center