simplify hybrid coeff parsing. check for number is already done with conversion

This commit is contained in:
Axel Kohlmeyer
2021-04-08 17:44:13 -04:00
parent 2d19282961
commit a441c7b379
2 changed files with 4 additions and 11 deletions

View File

@ -468,10 +468,7 @@ void PairHybrid::coeff(int narg, char **arg)
if (multiple[m]) {
multflag = 1;
if (narg < 4) error->all(FLERR,"Incorrect args for pair coefficients");
if (!isdigit(arg[3][0]))
error->all(FLERR,"Incorrect args for pair coefficients");
int index = utils::inumeric(FLERR,arg[3],false,lmp);
if (index == multiple[m]) break;
if (multiple[m] == utils::inumeric(FLERR,arg[3],false,lmp)) break;
else continue;
} else break;
}
@ -492,7 +489,7 @@ void PairHybrid::coeff(int narg, char **arg)
// invoke sub-style coeff() starting with 1st remaining arg
if (!none) styles[m]->coeff(narg-1-multflag,&arg[1+multflag]);
if (!none) styles[m]->coeff(narg-1-multflag,arg+1+multflag);
// if sub-style only allows one pair coeff call (with * * and type mapping)
// then unset setflag/map assigned to that style before setting it below