forked from lijiext/lammps
replace remaining calls to atof() with std::stod()
This commit is contained in:
parent
a54e67bf1c
commit
d68bc9f628
|
@ -134,11 +134,11 @@ FixEOStableRX::FixEOStableRX(LAMMPS *lmp, int narg, char **arg) :
|
|||
}
|
||||
|
||||
if (rx_flag) read_file(arg[7]);
|
||||
else dHf[0] = atof(arg[7]);
|
||||
else dHf[0] = std::stod(arg[7]);
|
||||
|
||||
if (narg==10) {
|
||||
energyCorr[0] = atof(arg[8]);
|
||||
tempCorrCoeff[0] = atof(arg[9]);
|
||||
energyCorr[0] = std::stod(arg[8]);
|
||||
tempCorrCoeff[0] = std::stod(arg[9]);
|
||||
}
|
||||
|
||||
comm_forward = 3;
|
||||
|
@ -373,11 +373,11 @@ void FixEOStableRX::read_file(char *file)
|
|||
if (strcmp(words[0],&atom->dvname[ispecies][0]) == 0) break;
|
||||
|
||||
if (ispecies < nspecies) {
|
||||
dHf[ispecies] = atof(words[1]);
|
||||
dHf[ispecies] = std::stod(words[1]);
|
||||
if (nwords > min_params_per_line+1) {
|
||||
energyCorr[ispecies] = atof(words[2]);
|
||||
tempCorrCoeff[ispecies] = atof(words[3]);
|
||||
moleculeCorrCoeff[ispecies] = atof(words[4]);
|
||||
energyCorr[ispecies] = std::stod(words[2]);
|
||||
tempCorrCoeff[ispecies] = std::stod(words[3]);
|
||||
moleculeCorrCoeff[ispecies] = std::stod(words[4]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -482,7 +482,7 @@ void FixEOStableRX::read_table(Table *tb, Table *tb2, char *file, char *keyword)
|
|||
|
||||
word = strtok(line," \t\n\r\f");
|
||||
word = strtok(nullptr," \t\n\r\f");
|
||||
rtmp = atof(word);
|
||||
rtmp = std::stod(word);
|
||||
|
||||
for (int icolumn=0; icolumn < ncolumn; icolumn++) {
|
||||
ispecies = eosSpecies[icolumn];
|
||||
|
@ -491,7 +491,7 @@ void FixEOStableRX::read_table(Table *tb, Table *tb2, char *file, char *keyword)
|
|||
Table *tbl2 = &tables2[ispecies];
|
||||
|
||||
word = strtok(nullptr," \t\n\r\f");
|
||||
tmpE = atof(word);
|
||||
tmpE = std::stod(word);
|
||||
|
||||
tbl->rfile[i] = rtmp;
|
||||
tbl->efile[i] = tmpE;
|
||||
|
|
|
@ -863,7 +863,7 @@ void FixRX::read_file(char *file)
|
|||
|
||||
word = strtok(line," \t\n\r\f");
|
||||
while (word != nullptr) {
|
||||
tmpStoich = atof(word);
|
||||
tmpStoich = std::stod(word);
|
||||
word = strtok(nullptr, " \t\n\r\f");
|
||||
for (ispecies = 0; ispecies < nspecies; ispecies++) {
|
||||
if (strcmp(word,&atom->dvname[ispecies][0]) == 0) {
|
||||
|
@ -886,13 +886,13 @@ void FixRX::read_file(char *file)
|
|||
if (strcmp(word,"=") == 0) sign = 1.0;
|
||||
if (strcmp(word,"+") != 0 && strcmp(word,"=") != 0) {
|
||||
if (word==nullptr) error->all(FLERR,"Missing parameters in reaction kinetic equation");
|
||||
Arr[nreactions] = atof(word);
|
||||
Arr[nreactions] = std::stod(word);
|
||||
word = strtok(nullptr, " \t\n\r\f");
|
||||
if (word==nullptr) error->all(FLERR,"Missing parameters in reaction kinetic equation");
|
||||
nArr[nreactions] = atof(word);
|
||||
nArr[nreactions] = std::stod(word);
|
||||
word = strtok(nullptr, " \t\n\r\f");
|
||||
if (word==nullptr) error->all(FLERR,"Missing parameters in reaction kinetic equation");
|
||||
Ea[nreactions] = atof(word);
|
||||
Ea[nreactions] = std::stod(word);
|
||||
sign = -1.0;
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -889,15 +889,15 @@ void PairExp6rx::read_file2(char *file)
|
|||
|
||||
if (strcmp(words[0],"alpha") == 0) {
|
||||
for (int ii=1; ii<params_per_line; ii++)
|
||||
coeffAlpha[ii-1] = atof(words[ii]);
|
||||
coeffAlpha[ii-1] = std::stod(words[ii]);
|
||||
}
|
||||
if (strcmp(words[0],"epsilon") == 0) {
|
||||
for (int ii=1; ii<params_per_line; ii++)
|
||||
coeffEps[ii-1] = atof(words[ii]);
|
||||
coeffEps[ii-1] = std::stod(words[ii]);
|
||||
}
|
||||
if (strcmp(words[0],"rm") == 0) {
|
||||
for (int ii=1; ii<params_per_line; ii++)
|
||||
coeffRm[ii-1] = atof(words[ii]);
|
||||
coeffRm[ii-1] = std::stod(words[ii]);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -486,15 +486,15 @@ void PairMultiLucy::param_extract(Table *tb, char *line)
|
|||
if (strcmp(word,"R") == 0) tb->rflag = RLINEAR;
|
||||
else if (strcmp(word,"RSQ") == 0) tb->rflag = RSQ;
|
||||
word = strtok(nullptr," \t\n\r\f");
|
||||
tb->rlo = atof(word);
|
||||
tb->rlo = std::stod(word);
|
||||
word = strtok(nullptr," \t\n\r\f");
|
||||
tb->rhi = atof(word);
|
||||
tb->rhi = std::stod(word);
|
||||
} else if (strcmp(word,"FP") == 0) {
|
||||
tb->fpflag = 1;
|
||||
word = strtok(nullptr," \t\n\r\f");
|
||||
tb->fplo = atof(word);
|
||||
tb->fplo = std::stod(word);
|
||||
word = strtok(nullptr," \t\n\r\f");
|
||||
tb->fphi = atof(word);
|
||||
tb->fphi = std::stod(word);
|
||||
} else {
|
||||
printf("WORD: %s\n",word);
|
||||
error->one(FLERR,"Invalid keyword in pair table parameters");
|
||||
|
|
|
@ -617,15 +617,15 @@ void PairMultiLucyRX::param_extract(Table *tb, char *line)
|
|||
if (strcmp(word,"R") == 0) tb->rflag = RLINEAR;
|
||||
else if (strcmp(word,"RSQ") == 0) tb->rflag = RSQ;
|
||||
word = strtok(nullptr," \t\n\r\f");
|
||||
tb->rlo = atof(word);
|
||||
tb->rlo = std::stod(word);
|
||||
word = strtok(nullptr," \t\n\r\f");
|
||||
tb->rhi = atof(word);
|
||||
tb->rhi = std::stod(word);
|
||||
} else if (strcmp(word,"FP") == 0) {
|
||||
tb->fpflag = 1;
|
||||
word = strtok(nullptr," \t\n\r\f");
|
||||
tb->fplo = atof(word);
|
||||
tb->fplo = std::stod(word);
|
||||
word = strtok(nullptr," \t\n\r\f");
|
||||
tb->fphi = atof(word);
|
||||
tb->fphi = std::stod(word);
|
||||
} else {
|
||||
printf("WORD: %s\n",word);
|
||||
error->one(FLERR,"Invalid keyword in pair table parameters");
|
||||
|
|
|
@ -1771,9 +1771,9 @@ void PairExp6rxKokkos<DeviceType>::read_file(char *file)
|
|||
params[nparams].potential = utils::strdup(words[1]);
|
||||
|
||||
if (strcmp(params[nparams].potential,"exp6") == 0) {
|
||||
params[nparams].alpha = atof(words[2]);
|
||||
params[nparams].epsilon = atof(words[3]);
|
||||
params[nparams].rm = atof(words[4]);
|
||||
params[nparams].alpha = std::stod(words[2]);
|
||||
params[nparams].epsilon = std::stod(words[3]);
|
||||
params[nparams].rm = std::stod(words[4]);
|
||||
if (params[nparams].epsilon <= 0.0 || params[nparams].rm <= 0.0 ||
|
||||
params[nparams].alpha < 0.0)
|
||||
error->all(FLERR,"Illegal exp6/rx parameters. Rm and Epsilon must be greater than zero. Alpha cannot be negative.");
|
||||
|
|
|
@ -531,7 +531,7 @@ void potdata::readpot(const char *parmin_file,const char *potin_file,const doubl
|
|||
|
||||
/*
|
||||
int main(int argc,char *argv[]) {
|
||||
double vol = atof(argv[3]);
|
||||
double vol = std::stod(argv[3]);
|
||||
int n = 25,i;
|
||||
|
||||
printf("%% parmin = %s\n%% potin = %s\n%% vol = %15.5e\n",
|
||||
|
|
Loading…
Reference in New Issue