used correct type parser and make conversions explicit

This commit is contained in:
Axel Kohlmeyer
2025-06-28 03:50:51 -04:00
parent 4992caed95
commit 1bdf30103f
5 changed files with 8 additions and 8 deletions

View File

@ -62,7 +62,7 @@ ComputeHexOrderAtom::ComputeHexOrderAtom(LAMMPS *lmp, int narg, char **arg) :
while (iarg < narg) {
if (strcmp(arg[iarg],"degree") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal compute hexorder/atom command");
ndegree = utils::numeric(FLERR,arg[iarg+1],false,lmp);
ndegree = utils::inumeric(FLERR,arg[iarg+1],false,lmp);
if (ndegree < 0)
error->all(FLERR,"Illegal compute hexorder/atom command");
iarg += 2;
@ -71,7 +71,7 @@ ComputeHexOrderAtom::ComputeHexOrderAtom(LAMMPS *lmp, int narg, char **arg) :
if (strcmp(arg[iarg+1],"NULL") == 0)
nnn = 0;
else {
nnn = utils::numeric(FLERR,arg[iarg+1],false,lmp);
nnn = utils::inumeric(FLERR,arg[iarg+1],false,lmp);
if (nnn < 0)
error->all(FLERR,"Illegal compute hexorder/atom command");
}

View File

@ -133,7 +133,7 @@ void PairCosineSquared::coeff(int narg, char **arg)
double sigma_one = utils::numeric(FLERR, arg[3],false,lmp);
double cut_one = cut_global;
double wca_one = 0;
int wca_one = 0;
if (narg == 6) {
cut_one = utils::numeric(FLERR, arg[4],false,lmp);
if (strcmp(arg[5], "wca") == 0) {

View File

@ -500,7 +500,7 @@ void FixWallGran::post_force(int /*vflag*/)
model->dx[2] = dz;
model->radi = radius[i];
model->radj = rwall;
if (model->beyond_contact) model->touch = history_one[i][0];
if (model->beyond_contact) model->touch = (history_one[i][0] != 0.0);
touchflag = model->check_contact();

View File

@ -235,7 +235,7 @@ void FixWallGranRegion::post_force(int /*vflag*/)
model->i = i;
model->j = ic;
if (model->beyond_contact) model->touch = history_many[i][c2r[ic]][0];
if (model->beyond_contact) model->touch = (history_many[i][c2r[ic]][0] != 0.0);
touchflag = model->check_contact();

View File

@ -788,10 +788,10 @@ LAMMPS::~LAMMPS() noexcept(false)
double totalclock = platform::walltime() - initclock;
if ((me == 0) && (screen || logfile)) {
int seconds = fmod(totalclock,60.0);
auto seconds = (int) fmod(totalclock,60.0);
totalclock = (totalclock - seconds) / 60.0;
int minutes = fmod(totalclock,60.0);
int hours = (totalclock - minutes) / 60.0;
auto minutes = (int) fmod(totalclock,60.0);
auto hours = (int) ((totalclock - minutes) / 60.0);
utils::logmesg(this, "Total wall time: {}:{:02d}:{:02d}\n", hours, minutes, seconds);
}