use utils::inumeric() for integers and use qualified auto

This commit is contained in:
Axel Kohlmeyer
2025-06-25 23:16:17 -04:00
parent de46b3b8bf
commit 1906444a1d
3 changed files with 9 additions and 9 deletions

View File

@ -115,7 +115,7 @@ void AtomVecDielectric::init()
if (utils::strmatch(force->pair_style, "dipole")) mismatch = true;
if (utils::strmatch(force->pair_style, "^hybrid")) {
auto hybrid = dynamic_cast<PairHybrid *>(force->pair);
auto *hybrid = dynamic_cast<PairHybrid *>(force->pair);
if (hybrid) {
for (int i = 0; i < hybrid->nstyles; i++) {
if (utils::strmatch(hybrid->keywords[i], "^reaxff")) mismatch = true;

View File

@ -75,7 +75,7 @@ FixPolarizeBEMGMRES::FixPolarizeBEMGMRES(LAMMPS *_lmp, int narg, char **arg) :
// parse required arguments
nevery = utils::numeric(FLERR, arg[3], false, lmp);
nevery = utils::inumeric(FLERR, arg[3], false, lmp);
if (nevery < 0) error->all(FLERR, "Illegal fix polarize/bem/gmres command");
double tol = utils::numeric(FLERR, arg[4], false, lmp);
tol_abs = tol_rel = tol;
@ -210,7 +210,7 @@ void FixPolarizeBEMGMRES::init()
if (randomized) {
auto random = new RanPark(lmp, seed_charge + comm->me);
auto *random = new RanPark(lmp, seed_charge + comm->me);
for (i = 0; i < 100; i++) random->uniform();
double sum, tmp = 0;
for (i = 0; i < nlocal; i++) {
@ -827,11 +827,11 @@ int FixPolarizeBEMGMRES::modify_param(int narg, char **arg)
while (iarg < narg) {
if (strcmp(arg[iarg], "itr_max") == 0) {
if (iarg + 2 > narg) error->all(FLERR, "Illegal fix_modify command");
itr_max = utils::numeric(FLERR, arg[iarg + 1], false, lmp);
itr_max = utils::inumeric(FLERR, arg[iarg + 1], false, lmp);
iarg += 2;
} else if (strcmp(arg[iarg], "mr") == 0) {
if (iarg + 2 > narg) error->all(FLERR, "Illegal fix_modify command");
mr = utils::numeric(FLERR, arg[iarg + 1], false, lmp);
mr = utils::inumeric(FLERR, arg[iarg + 1], false, lmp);
iarg += 2;
} else if (strcmp(arg[iarg], "kspace") == 0) {
if (iarg + 2 > narg) error->all(FLERR, "Illegal fix_modify command");
@ -858,7 +858,7 @@ int FixPolarizeBEMGMRES::modify_param(int narg, char **arg)
} else if (strcmp(arg[iarg], "rand") == 0) {
if (iarg + 3 > narg) error->all(FLERR, "Illegal fix_modify command");
ave_charge = utils::numeric(FLERR, arg[iarg + 1], false, lmp);
seed_charge = utils::numeric(FLERR, arg[iarg + 2], false, lmp);
seed_charge = utils::inumeric(FLERR, arg[iarg + 2], false, lmp);
randomized = 1;
iarg += 3;
} else

View File

@ -120,7 +120,7 @@ void FixPolarizeBEMICC::init()
int *mask = atom->mask;
int nlocal = atom->nlocal;
auto random = new RanPark(lmp, seed_charge + comm->me);
auto *random = new RanPark(lmp, seed_charge + comm->me);
for (i = 0; i < 100; i++) random->uniform();
double sum, tmp = 0;
for (i = 0; i < nlocal; i++) {
@ -385,7 +385,7 @@ int FixPolarizeBEMICC::modify_param(int narg, char **arg)
while (iarg < narg) {
if (strcmp(arg[iarg], "itr_max") == 0) {
if (iarg + 2 > narg) error->all(FLERR, "Illegal fix_modify command");
itr_max = utils::numeric(FLERR, arg[iarg + 1], false, lmp);
itr_max = utils::inumeric(FLERR, arg[iarg + 1], false, lmp);
iarg += 2;
} else if (strcmp(arg[iarg], "omega") == 0) {
if (iarg + 2 > narg) error->all(FLERR, "Illegal fix_modify command");
@ -416,7 +416,7 @@ int FixPolarizeBEMICC::modify_param(int narg, char **arg)
} else if (strcmp(arg[iarg], "rand") == 0) {
if (iarg + 3 > narg) error->all(FLERR, "Illegal fix_modify command");
ave_charge = utils::numeric(FLERR, arg[iarg + 1], false, lmp);
seed_charge = utils::numeric(FLERR, arg[iarg + 2], false, lmp);
seed_charge = utils::inumeric(FLERR, arg[iarg + 2], false, lmp);
randomized = 1;
iarg += 3;
} else