diff --git a/src/DPD-REACT/fix_eos_table_rx.cpp b/src/DPD-REACT/fix_eos_table_rx.cpp index bf71b502f0..d53ba91a50 100644 --- a/src/DPD-REACT/fix_eos_table_rx.cpp +++ b/src/DPD-REACT/fix_eos_table_rx.cpp @@ -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; diff --git a/src/DPD-REACT/fix_rx.cpp b/src/DPD-REACT/fix_rx.cpp index a7e9e4ea77..fe7538bd10 100644 --- a/src/DPD-REACT/fix_rx.cpp +++ b/src/DPD-REACT/fix_rx.cpp @@ -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; } diff --git a/src/DPD-REACT/pair_exp6_rx.cpp b/src/DPD-REACT/pair_exp6_rx.cpp index e0ac9c0b27..0cd9dd3a05 100644 --- a/src/DPD-REACT/pair_exp6_rx.cpp +++ b/src/DPD-REACT/pair_exp6_rx.cpp @@ -889,15 +889,15 @@ void PairExp6rx::read_file2(char *file) if (strcmp(words[0],"alpha") == 0) { for (int ii=1; iirflag = 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"); diff --git a/src/DPD-REACT/pair_multi_lucy_rx.cpp b/src/DPD-REACT/pair_multi_lucy_rx.cpp index c248d92694..5acf40c72f 100644 --- a/src/DPD-REACT/pair_multi_lucy_rx.cpp +++ b/src/DPD-REACT/pair_multi_lucy_rx.cpp @@ -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"); diff --git a/src/KOKKOS/pair_exp6_rx_kokkos.cpp b/src/KOKKOS/pair_exp6_rx_kokkos.cpp index dad7413669..7eddd7527e 100644 --- a/src/KOKKOS/pair_exp6_rx_kokkos.cpp +++ b/src/KOKKOS/pair_exp6_rx_kokkos.cpp @@ -1771,9 +1771,9 @@ void PairExp6rxKokkos::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."); diff --git a/src/MGPT/mgpt_readpot.cpp b/src/MGPT/mgpt_readpot.cpp index 3cc5d5d693..3bb39ab353 100644 --- a/src/MGPT/mgpt_readpot.cpp +++ b/src/MGPT/mgpt_readpot.cpp @@ -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",