throw error for illegal replication values

This commit is contained in:
Axel Kohlmeyer
2023-11-15 08:03:15 -05:00
parent c272e8f94f
commit 3a2d94822a

View File

@ -52,8 +52,11 @@ void Replicate::command(int narg, char **arg)
int nx = utils::inumeric(FLERR,arg[0],false,lmp);
int ny = utils::inumeric(FLERR,arg[1],false,lmp);
int nz = utils::inumeric(FLERR,arg[2],false,lmp);
int nrep = nx*ny*nz;
if ((nx <= 0) || (ny <= 0) || (nz <= 0))
error->all(FLERR, "Illegal replication grid {}x{}x{}. All replications must be > 0",
nx, ny, nz);
int nrep = nx*ny*nz;
if (me == 0)
utils::logmesg(lmp, "Replication is creating a {}x{}x{} = {} times larger system...\n",
nx, ny, nz, nrep);