apply fix from balance command to fix balance

This commit is contained in:
Axel Kohlmeyer
2021-09-17 22:52:58 -04:00
parent cb2de211b2
commit a46b8688ea
2 changed files with 4 additions and 3 deletions

View File

@ -64,14 +64,15 @@ FixBalance::FixBalance(LAMMPS *lmp, int narg, char **arg) :
int iarg = 5;
if (lbstyle == SHIFT) {
if (iarg+4 > narg) error->all(FLERR,"Illegal fix balance command");
if (strlen(arg[iarg+1]) > 3)
if (strlen(arg[iarg+1]) > Balance::BSTR_SIZE)
error->all(FLERR,"Illegal fix balance command");
strcpy(bstr,arg[iarg+1]);
strncpy(bstr,arg[iarg+1], Balance::BSTR_SIZE+1);
nitermax = utils::inumeric(FLERR,arg[iarg+2],false,lmp);
if (nitermax <= 0) error->all(FLERR,"Illegal fix balance command");
stopthresh = utils::numeric(FLERR,arg[iarg+3],false,lmp);
if (stopthresh < 1.0) error->all(FLERR,"Illegal fix balance command");
iarg += 4;
} else if (lbstyle == BISECTION) {
iarg++;
}