diff --git a/src/DPD/pair_dpd.cpp b/src/DPD/pair_dpd.cpp index c1602a69b1..7bea9574cc 100644 --- a/src/DPD/pair_dpd.cpp +++ b/src/DPD/pair_dpd.cpp @@ -202,8 +202,7 @@ void PairDPD::settings(int narg, char **arg) // initialize Marsaglia RNG with processor-unique seed - if (seed <= 0 || seed > 900000000) - error->all("Illegal fix pair_style command"); + if (seed <= 0) error->all("Illegal fix pair_style command"); if (random) delete random; random = new RanMars(lmp,seed + comm->me); diff --git a/src/GRANULAR/fix_pour.cpp b/src/GRANULAR/fix_pour.cpp index a392c5b6a8..c580123c53 100644 --- a/src/GRANULAR/fix_pour.cpp +++ b/src/GRANULAR/fix_pour.cpp @@ -51,6 +51,8 @@ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) : ntype = atoi(arg[4]); seed = atoi(arg[5]); + if (seed <= 0) error->all("Illegal fix pour command"); + PI = 4.0*atan(1.0); // option defaults diff --git a/src/displace_atoms.cpp b/src/displace_atoms.cpp index 6bb5ffab99..ab32959e80 100644 --- a/src/displace_atoms.cpp +++ b/src/displace_atoms.cpp @@ -175,6 +175,7 @@ void DisplaceAtoms::command(int narg, char **arg) double dy = yscale*atof(arg[3]); double dz = zscale*atof(arg[4]); int seed = atoi(arg[5]); + if (seed <= 0) error->all("Illegal displace_atoms random command"); double **x = atom->x; int *mask = atom->mask; diff --git a/src/fix_deposit.cpp b/src/fix_deposit.cpp index 24d1ec2388..fbaa5f4b81 100644 --- a/src/fix_deposit.cpp +++ b/src/fix_deposit.cpp @@ -43,6 +43,8 @@ FixDeposit::FixDeposit(LAMMPS *lmp, int narg, char **arg) : nfreq = atoi(arg[5]); seed = atoi(arg[6]); + if (seed <= 0) error->all("Illegal fix deposit command"); + // set defaults iregion = -1; diff --git a/src/fix_indent.h b/src/fix_indent.h index f64b5bf62e..f0604146da 100644 --- a/src/fix_indent.h +++ b/src/fix_indent.h @@ -25,13 +25,13 @@ class FixIndent : public Fix { void init(); void setup(); void min_setup(); - void post_force(int); + virtual void post_force(int); void post_force_respa(int, int, int); void min_post_force(int); double compute_scalar(); double compute_vector(int); - private: + protected: int istyle,scaleflag,radflag,thermo_flag,eflag_enable; double k,k3; double x0,y0,z0,r0_stop,r0_start; diff --git a/src/fix_langevin.cpp b/src/fix_langevin.cpp index 4753845af7..7fb556639e 100644 --- a/src/fix_langevin.cpp +++ b/src/fix_langevin.cpp @@ -41,8 +41,7 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) : int seed = atoi(arg[6]); if (t_period <= 0.0) error->all("Fix langevin period must be > 0.0"); - if (seed <= 0 || seed > 900000000) - error->all("Illegal fix langevin command"); + if (seed <= 0) error->all("Illegal fix langevin command"); // initialize Marsaglia RNG with processor-unique seed diff --git a/src/random_park.cpp b/src/random_park.cpp index 47c408e7fa..0c01d1eb8c 100644 --- a/src/random_park.cpp +++ b/src/random_park.cpp @@ -40,7 +40,7 @@ using namespace LAMMPS_NS; RanPark::RanPark(LAMMPS *lmp, int seed_init) : Pointers(lmp) { - if (seed_init == 0) error->all("Invalid seed for Park random # generator"); + if (seed_init <= 0) error->all("Invalid seed for Park random # generator"); seed = seed_init; save = 0; } diff --git a/src/velocity.cpp b/src/velocity.cpp index 138891fc30..8747dcebae 100644 --- a/src/velocity.cpp +++ b/src/velocity.cpp @@ -126,6 +126,8 @@ void Velocity::create(int narg, char **arg) double t_desired = atof(arg[0]); int seed = atoi(arg[1]); + if (seed <= 0) error->all("Illegal velocity create command"); + // if temperature = NULL, create a new ComputeTemp with the velocity group int tflag = 0;