replace a few more cases of atoi()/atof() with utils::*numeric() functions

This commit is contained in:
Axel Kohlmeyer
2021-02-21 15:09:50 -05:00
parent d5917652d4
commit 826c618aa9
4 changed files with 22 additions and 16 deletions

View File

@ -254,13 +254,19 @@ void FixPropertyAtom::read_data_section(char *keyword, int n, char *buf,
if ((m = atom->map(itag)) >= 0) {
for (j = 0; j < nvalue; j++) {
if (style[j] == MOLECULE) atom->molecule[m] = ATOTAGINT(values[j+1]);
else if (style[j] == CHARGE) atom->q[m] = atof(values[j+1]);
else if (style[j] == RMASS) atom->rmass[m] = atof(values[j+1]);
else if (style[j] == INTEGER)
atom->ivector[index[j]][m] = atoi(values[j+1]);
else if (style[j] == DOUBLE)
atom->dvector[index[j]][m] = atof(values[j+1]);
if (style[j] == MOLECULE) {
atom->molecule[m] = utils::tnumeric(FLERR,values[j+1],false,lmp);
} else if (style[j] == CHARGE) {
atom->q[m] = utils::numeric(FLERR,values[j+1],false,lmp);
} else if (style[j] == RMASS) {
atom->rmass[m] = utils::numeric(FLERR,values[j+1],false,lmp);
} else if (style[j] == INTEGER) {
atom->ivector[index[j]][m] = utils::inumeric(FLERR,values[j+1],
false,lmp);
} else if (style[j] == DOUBLE) {
atom->dvector[index[j]][m] = utils::numeric(FLERR,values[j+1],
true,lmp);
}
}
}