diff --git a/src/KSPACE/fix_tune_kspace.cpp b/src/KSPACE/fix_tune_kspace.cpp index 2dbed26941..5ce867778d 100644 --- a/src/KSPACE/fix_tune_kspace.cpp +++ b/src/KSPACE/fix_tune_kspace.cpp @@ -63,6 +63,7 @@ FixTuneKspace::FixTuneKspace(LAMMPS *lmp, int narg, char **arg) : // parse arguments nevery = force->inumeric(FLERR,arg[3]); + if (nevery <= 0) error->all(FLERR,"Illegal fix tune/kspace command"); // set up reneighboring diff --git a/src/MC/fix_atom_swap.cpp b/src/MC/fix_atom_swap.cpp index 7cdee69c39..689aa0a168 100644 --- a/src/MC/fix_atom_swap.cpp +++ b/src/MC/fix_atom_swap.cpp @@ -79,6 +79,7 @@ FixAtomSwap::FixAtomSwap(LAMMPS *lmp, int narg, char **arg) : double temperature = force->numeric(FLERR,arg[6]); beta = 1.0/(force->boltz*temperature); + if (nevery <= 0) error->all(FLERR,"Illegal fix atom/swap command"); if (ncycles < 0) error->all(FLERR,"Illegal fix atom/swap command"); if (seed <= 0) error->all(FLERR,"Illegal fix atom/swap command"); diff --git a/src/MC/fix_gcmc.cpp b/src/MC/fix_gcmc.cpp index 849783ae5e..2fb0015f7b 100644 --- a/src/MC/fix_gcmc.cpp +++ b/src/MC/fix_gcmc.cpp @@ -85,6 +85,7 @@ FixGCMC::FixGCMC(LAMMPS *lmp, int narg, char **arg) : chemical_potential = force->numeric(FLERR,arg[9]); displace = force->numeric(FLERR,arg[10]); + if (nevery <= 0) error->all(FLERR,"Illegal fix gcmc command"); if (nexchanges < 0) error->all(FLERR,"Illegal fix gcmc command"); if (nmcmoves < 0) error->all(FLERR,"Illegal fix gcmc command"); if (seed <= 0) error->all(FLERR,"Illegal fix gcmc command"); diff --git a/src/QEQ/fix_qeq.cpp b/src/QEQ/fix_qeq.cpp index d33c841b56..bc044ebae4 100644 --- a/src/QEQ/fix_qeq.cpp +++ b/src/QEQ/fix_qeq.cpp @@ -55,6 +55,10 @@ FixQEq::FixQEq(LAMMPS *lmp, int narg, char **arg) : tolerance = force->numeric(FLERR,arg[5]); maxiter = force->inumeric(FLERR,arg[6]); + // check for sane arguments + if ((nevery <= 0) || (cutoff <= 0.0) || (tolerance <= 0.0) || (maxiter <= 0)) + error->all(FLERR,"Illegal fix qeq command"); + alpha = 0.20; swa = 0.0; swb = cutoff; diff --git a/src/REPLICA/neb.cpp b/src/REPLICA/neb.cpp index 68d2af8bd9..1521598812 100644 --- a/src/REPLICA/neb.cpp +++ b/src/REPLICA/neb.cpp @@ -122,7 +122,7 @@ void NEB::command(int narg, char **arg) if (etol < 0.0) error->all(FLERR,"Illegal NEB command"); if (ftol < 0.0) error->all(FLERR,"Illegal NEB command"); - if (nevery == 0) error->universe_all(FLERR,"Illegal NEB command"); + if (nevery <= 0) error->universe_all(FLERR,"Illegal NEB command"); if (n1steps % nevery || n2steps % nevery) error->universe_all(FLERR,"Illegal NEB command"); diff --git a/src/REPLICA/temper.cpp b/src/REPLICA/temper.cpp index 5b6c310911..ebc26d6061 100644 --- a/src/REPLICA/temper.cpp +++ b/src/REPLICA/temper.cpp @@ -87,7 +87,7 @@ void Temper::command(int narg, char **arg) // swap frequency must evenly divide total # of timesteps - if (nevery == 0) + if (nevery <= 0) error->universe_all(FLERR,"Invalid frequency in temper command"); nswaps = nsteps/nevery; if (nswaps*nevery != nsteps) diff --git a/src/USER-REAXC/fix_qeq_reax.cpp b/src/USER-REAXC/fix_qeq_reax.cpp index bb0fe3e6d7..0dbb864fb7 100644 --- a/src/USER-REAXC/fix_qeq_reax.cpp +++ b/src/USER-REAXC/fix_qeq_reax.cpp @@ -71,6 +71,8 @@ FixQEqReax::FixQEqReax(LAMMPS *lmp, int narg, char **arg) : if (narg != 8) error->all(FLERR,"Illegal fix qeq/reax command"); nevery = force->inumeric(FLERR,arg[3]); + if (nevery <= 0) error->all(FLERR,"Illegal fix qeq/reax command"); + swa = force->numeric(FLERR,arg[4]); swb = force->numeric(FLERR,arg[5]); tolerance = force->numeric(FLERR,arg[6]); diff --git a/src/dump_custom.cpp b/src/dump_custom.cpp index cecaa9b3f8..68097e543d 100644 --- a/src/dump_custom.cpp +++ b/src/dump_custom.cpp @@ -60,6 +60,7 @@ DumpCustom::DumpCustom(LAMMPS *lmp, int narg, char **arg) : clearstep = 1; nevery = force->inumeric(FLERR,arg[3]); + if (nevery <= 0) error->all(FLERR,"Illegal dump custom command"); // size_one may be shrunk below if additional optional args exist diff --git a/src/dump_local.cpp b/src/dump_local.cpp index eb08a912fc..e290accede 100644 --- a/src/dump_local.cpp +++ b/src/dump_local.cpp @@ -43,6 +43,8 @@ DumpLocal::DumpLocal(LAMMPS *lmp, int narg, char **arg) : clearstep = 1; nevery = force->inumeric(FLERR,arg[3]); + if (nevery <= 0) error->all(FLERR,"Illegal dump local command"); + size_one = nfield = narg-5; pack_choice = new FnPtrPack[nfield];