diff --git a/src/DIPOLE/atom_vec_dipole.cpp b/src/DIPOLE/atom_vec_dipole.cpp index c304ae3bc6..c6f8fbb432 100644 --- a/src/DIPOLE/atom_vec_dipole.cpp +++ b/src/DIPOLE/atom_vec_dipole.cpp @@ -780,19 +780,19 @@ void AtomVecDipole::data_atom(double *coord, imageint imagetmp, char **values) if (nlocal == nmax) grow(0); tag[nlocal] = ATOTAGINT(values[0]); - type[nlocal] = atoi(values[1]); + type[nlocal] = force->inumeric(FLERR,values[1]); if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); - q[nlocal] = atof(values[2]); + q[nlocal] = force->numeric(FLERR,values[2]); x[nlocal][0] = coord[0]; x[nlocal][1] = coord[1]; x[nlocal][2] = coord[2]; - mu[nlocal][0] = atof(values[6]); - mu[nlocal][1] = atof(values[7]); - mu[nlocal][2] = atof(values[8]); + mu[nlocal][0] = force->numeric(FLERR,values[6]); + mu[nlocal][1] = force->numeric(FLERR,values[7]); + mu[nlocal][2] = force->numeric(FLERR,values[8]); mu[nlocal][3] = sqrt(mu[nlocal][0]*mu[nlocal][0] + mu[nlocal][1]*mu[nlocal][1] + mu[nlocal][2]*mu[nlocal][2]); @@ -814,10 +814,10 @@ void AtomVecDipole::data_atom(double *coord, imageint imagetmp, char **values) int AtomVecDipole::data_atom_hybrid(int nlocal, char **values) { - q[nlocal] = atof(values[0]); - mu[nlocal][0] = atof(values[1]); - mu[nlocal][1] = atof(values[2]); - mu[nlocal][2] = atof(values[3]); + q[nlocal] = force->numeric(FLERR,values[0]); + mu[nlocal][0] = force->numeric(FLERR,values[1]); + mu[nlocal][1] = force->numeric(FLERR,values[2]); + mu[nlocal][2] = force->numeric(FLERR,values[3]); mu[nlocal][3] = sqrt(mu[nlocal][0]*mu[nlocal][0] + mu[nlocal][1]*mu[nlocal][1] + mu[nlocal][2]*mu[nlocal][2]); diff --git a/src/KOKKOS/atom_vec_angle_kokkos.cpp b/src/KOKKOS/atom_vec_angle_kokkos.cpp index e4f27e733a..36fa47c712 100644 --- a/src/KOKKOS/atom_vec_angle_kokkos.cpp +++ b/src/KOKKOS/atom_vec_angle_kokkos.cpp @@ -1632,9 +1632,9 @@ void AtomVecAngleKokkos::data_atom(double *coord, imageint imagetmp, if (nlocal == nmax) grow(0); atomKK->modified(Host,ALL_MASK); - h_tag(nlocal) = atoi(values[0]); - h_molecule(nlocal) = atoi(values[1]); - h_type(nlocal) = atoi(values[2]); + h_tag(nlocal) = force->inumeric(FLERR,values[0]); + h_molecule(nlocal) = force->inumeric(FLERR,values[1]); + h_type(nlocal) = force->inumeric(FLERR,values[2]); if (h_type(nlocal) <= 0 || h_type(nlocal) > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); @@ -1661,7 +1661,7 @@ void AtomVecAngleKokkos::data_atom(double *coord, imageint imagetmp, int AtomVecAngleKokkos::data_atom_hybrid(int nlocal, char **values) { - h_molecule(nlocal) = atoi(values[0]); + h_molecule(nlocal) = force->inumeric(FLERR,values[0]); h_num_bond(nlocal) = 0; h_num_angle(nlocal) = 0; return 1; diff --git a/src/KOKKOS/atom_vec_atomic_kokkos.cpp b/src/KOKKOS/atom_vec_atomic_kokkos.cpp index 95e4ddd72b..61703d1cc8 100644 --- a/src/KOKKOS/atom_vec_atomic_kokkos.cpp +++ b/src/KOKKOS/atom_vec_atomic_kokkos.cpp @@ -823,8 +823,8 @@ void AtomVecAtomicKokkos::data_atom(double *coord, tagint imagetmp, int nlocal = atom->nlocal; if (nlocal == nmax) grow(0); - h_tag[nlocal] = atoi(values[0]); - h_type[nlocal] = atoi(values[1]); + h_tag[nlocal] = force->inumeric(FLERR,values[0]); + h_type[nlocal] = force->inumeric(FLERR,values[1]); if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); diff --git a/src/KOKKOS/atom_vec_bond_kokkos.cpp b/src/KOKKOS/atom_vec_bond_kokkos.cpp index 92311d5d09..bbf9f58b58 100644 --- a/src/KOKKOS/atom_vec_bond_kokkos.cpp +++ b/src/KOKKOS/atom_vec_bond_kokkos.cpp @@ -1058,9 +1058,9 @@ void AtomVecBondKokkos::data_atom(double *coord, imageint imagetmp, if (nlocal == nmax) grow(0); atomKK->modified(Host,ALL_MASK); - h_tag(nlocal) = atoi(values[0]); - h_molecule(nlocal) = atoi(values[1]); - h_type(nlocal) = atoi(values[2]); + h_tag(nlocal) = force->inumeric(FLERR,values[0]); + h_molecule(nlocal) = force->inumeric(FLERR,values[1]); + h_type(nlocal) = force->inumeric(FLERR,values[2]); if (h_type(nlocal) <= 0 || h_type(nlocal) > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); @@ -1086,7 +1086,7 @@ void AtomVecBondKokkos::data_atom(double *coord, imageint imagetmp, int AtomVecBondKokkos::data_atom_hybrid(int nlocal, char **values) { - h_molecule(nlocal) = atoi(values[0]); + h_molecule(nlocal) = force->inumeric(FLERR,values[0]); h_num_bond(nlocal) = 0; return 1; } diff --git a/src/KOKKOS/atom_vec_charge_kokkos.cpp b/src/KOKKOS/atom_vec_charge_kokkos.cpp index 31a690f521..be267d8b16 100644 --- a/src/KOKKOS/atom_vec_charge_kokkos.cpp +++ b/src/KOKKOS/atom_vec_charge_kokkos.cpp @@ -959,12 +959,12 @@ void AtomVecChargeKokkos::data_atom(double *coord, imageint imagetmp, int nlocal = atom->nlocal; if (nlocal == nmax) grow(0); - h_tag[nlocal] = atoi(values[0]); - h_type[nlocal] = atoi(values[1]); + h_tag[nlocal] = force->inumeric(FLERR,values[0]); + h_type[nlocal] = force->inumeric(FLERR,values[1]); if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); - h_q[nlocal] = atof(values[2]); + h_q[nlocal] = force->numeric(FLERR,values[2]); h_x(nlocal,0) = coord[0]; h_x(nlocal,1) = coord[1]; @@ -988,7 +988,7 @@ void AtomVecChargeKokkos::data_atom(double *coord, imageint imagetmp, int AtomVecChargeKokkos::data_atom_hybrid(int nlocal, char **values) { - h_q[nlocal] = atof(values[0]); + h_q[nlocal] = force->numeric(FLERR,values[0]); return 1; } diff --git a/src/KOKKOS/atom_vec_dpd_kokkos.cpp b/src/KOKKOS/atom_vec_dpd_kokkos.cpp index 4034efee9e..ffbfc75a93 100644 --- a/src/KOKKOS/atom_vec_dpd_kokkos.cpp +++ b/src/KOKKOS/atom_vec_dpd_kokkos.cpp @@ -1723,11 +1723,11 @@ void AtomVecDPDKokkos::data_atom(double *coord, tagint imagetmp, if (nlocal == nmax) grow(0); h_tag[nlocal] = ATOTAGINT(values[0]); - h_type[nlocal] = atoi(values[1]); + h_type[nlocal] = force->inumeric(FLERR,values[1]); if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); - h_dpdTheta[nlocal] = atof(values[2]); + h_dpdTheta[nlocal] = force->numeric(FLERR,values[2]); if (h_dpdTheta[nlocal] <= 0) error->one(FLERR,"Internal temperature in Atoms section of date file must be > zero"); @@ -1761,7 +1761,7 @@ void AtomVecDPDKokkos::data_atom(double *coord, tagint imagetmp, int AtomVecDPDKokkos::data_atom_hybrid(int nlocal, char **values) { - h_dpdTheta(nlocal) = atof(values[0]); + h_dpdTheta(nlocal) = force->numeric(FLERR,values[0]); atomKK->modified(Host,DPDTHETA_MASK); diff --git a/src/KOKKOS/atom_vec_full_kokkos.cpp b/src/KOKKOS/atom_vec_full_kokkos.cpp index 034da88f73..1974c12ebb 100644 --- a/src/KOKKOS/atom_vec_full_kokkos.cpp +++ b/src/KOKKOS/atom_vec_full_kokkos.cpp @@ -1487,13 +1487,13 @@ void AtomVecFullKokkos::data_atom(double *coord, imageint imagetmp, if (nlocal == nmax) grow(0); atomKK->modified(Host,ALL_MASK); - h_tag(nlocal) = atoi(values[0]); - h_molecule(nlocal) = atoi(values[1]); - h_type(nlocal) = atoi(values[2]); + h_tag(nlocal) = force->inumeric(FLERR,values[0]); + h_molecule(nlocal) = force->inumeric(FLERR,values[1]); + h_type(nlocal) = force->inumeric(FLERR,values[2]); if (h_type(nlocal) <= 0 || h_type(nlocal) > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); - h_q(nlocal) = atof(values[3]); + h_q(nlocal) = force->numeric(FLERR,values[3]); h_x(nlocal,0) = coord[0]; h_x(nlocal,1) = coord[1]; @@ -1520,8 +1520,8 @@ void AtomVecFullKokkos::data_atom(double *coord, imageint imagetmp, int AtomVecFullKokkos::data_atom_hybrid(int nlocal, char **values) { - h_molecule(nlocal) = atoi(values[0]); - h_q(nlocal) = atof(values[1]); + h_molecule(nlocal) = force->inumeric(FLERR,values[0]); + h_q(nlocal) = force->numeric(FLERR,values[1]); h_num_bond(nlocal) = 0; h_num_angle(nlocal) = 0; h_num_dihedral(nlocal) = 0; diff --git a/src/KOKKOS/atom_vec_hybrid_kokkos.cpp b/src/KOKKOS/atom_vec_hybrid_kokkos.cpp index 03cbe1ee5e..88dbdd068a 100644 --- a/src/KOKKOS/atom_vec_hybrid_kokkos.cpp +++ b/src/KOKKOS/atom_vec_hybrid_kokkos.cpp @@ -975,7 +975,7 @@ void AtomVecHybridKokkos::data_atom(double *coord, imageint imagetmp, char **val if (nlocal == nmax) grow(0); h_tag[nlocal] = ATOTAGINT(values[0]); - h_type[nlocal] = atoi(values[1]); + h_type[nlocal] = force->inumeric(FLERR,values[1]); if (h_type[nlocal] <= 0 || h_type[nlocal] > atom->ntypes) error->one(FLERR,"Invalid atom h_type in Atoms section of data file"); @@ -1019,9 +1019,9 @@ void AtomVecHybridKokkos::data_vel(int m, char **values) { atomKK->sync(Host,V_MASK); - h_v(m,0) = atof(values[0]); - h_v(m,1) = atof(values[1]); - h_v(m,2) = atof(values[2]); + h_v(m,0) = force->numeric(FLERR,values[0]); + h_v(m,1) = force->numeric(FLERR,values[1]); + h_v(m,2) = force->numeric(FLERR,values[2]); atomKK->modified(Host,V_MASK); diff --git a/src/KOKKOS/atom_vec_molecular_kokkos.cpp b/src/KOKKOS/atom_vec_molecular_kokkos.cpp index 9ac8ecd264..060228f37e 100644 --- a/src/KOKKOS/atom_vec_molecular_kokkos.cpp +++ b/src/KOKKOS/atom_vec_molecular_kokkos.cpp @@ -1891,9 +1891,9 @@ void AtomVecMolecularKokkos::data_atom(double *coord, imageint imagetmp, if (nlocal == nmax) grow(0); atomKK->modified(Host,ALL_MASK); - h_tag(nlocal) = atoi(values[0]); - h_molecule(nlocal) = atoi(values[1]); - h_type(nlocal) = atoi(values[2]); + h_tag(nlocal) = force->inumeric(FLERR,values[0]); + h_molecule(nlocal) = force->inumeric(FLERR,values[1]); + h_type(nlocal) = force->inumeric(FLERR,values[2]); if (h_type(nlocal) <= 0 || h_type(nlocal) > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); @@ -1922,7 +1922,7 @@ void AtomVecMolecularKokkos::data_atom(double *coord, imageint imagetmp, int AtomVecMolecularKokkos::data_atom_hybrid(int nlocal, char **values) { - h_molecule(nlocal) = atoi(values[0]); + h_molecule(nlocal) = force->inumeric(FLERR,values[0]); h_num_bond(nlocal) = 0; h_num_angle(nlocal) = 0; h_num_dihedral(nlocal) = 0; diff --git a/src/KOKKOS/atom_vec_sphere_kokkos.cpp b/src/KOKKOS/atom_vec_sphere_kokkos.cpp index 9e8388488f..57dc7ef43d 100644 --- a/src/KOKKOS/atom_vec_sphere_kokkos.cpp +++ b/src/KOKKOS/atom_vec_sphere_kokkos.cpp @@ -2549,15 +2549,15 @@ void AtomVecSphereKokkos::data_atom(double *coord, imageint imagetmp, char **val if (nlocal == nmax) grow(0); tag[nlocal] = ATOTAGINT(values[0]); - type[nlocal] = atoi(values[1]); + type[nlocal] = force->inumeric(FLERR,values[1]); if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); - radius[nlocal] = 0.5 * atof(values[2]); + radius[nlocal] = 0.5 * force->numeric(FLERR,values[2]); if (radius[nlocal] < 0.0) error->one(FLERR,"Invalid radius in Atoms section of data file"); - double density = atof(values[3]); + double density = force->numeric(FLERR,values[3]); if (density <= 0.0) error->one(FLERR,"Invalid density in Atoms section of data file"); @@ -2592,11 +2592,11 @@ void AtomVecSphereKokkos::data_atom(double *coord, imageint imagetmp, char **val int AtomVecSphereKokkos::data_atom_hybrid(int nlocal, char **values) { - radius[nlocal] = 0.5 * atof(values[0]); + radius[nlocal] = 0.5 * force->numeric(FLERR,values[0]); if (radius[nlocal] < 0.0) error->one(FLERR,"Invalid radius in Atoms section of data file"); - double density = atof(values[1]); + double density = force->numeric(FLERR,values[1]); if (density <= 0.0) error->one(FLERR,"Invalid density in Atoms section of data file"); @@ -2618,12 +2618,12 @@ int AtomVecSphereKokkos::data_atom_hybrid(int nlocal, char **values) void AtomVecSphereKokkos::data_vel(int m, char **values) { atomKK->sync(Host,V_MASK|OMEGA_MASK); - h_v(m,0) = atof(values[0]); - h_v(m,1) = atof(values[1]); - h_v(m,2) = atof(values[2]); - h_omega(m,0) = atof(values[3]); - h_omega(m,1) = atof(values[4]); - h_omega(m,2) = atof(values[5]); + h_v(m,0) = force->numeric(FLERR,values[0]); + h_v(m,1) = force->numeric(FLERR,values[1]); + h_v(m,2) = force->numeric(FLERR,values[2]); + h_omega(m,0) = force->numeric(FLERR,values[3]); + h_omega(m,1) = force->numeric(FLERR,values[4]); + h_omega(m,2) = force->numeric(FLERR,values[5]); atomKK->modified(Host,V_MASK|OMEGA_MASK); } @@ -2634,9 +2634,9 @@ void AtomVecSphereKokkos::data_vel(int m, char **values) int AtomVecSphereKokkos::data_vel_hybrid(int m, char **values) { atomKK->sync(Host,OMEGA_MASK); - omega[m][0] = atof(values[0]); - omega[m][1] = atof(values[1]); - omega[m][2] = atof(values[2]); + omega[m][0] = force->numeric(FLERR,values[0]); + omega[m][1] = force->numeric(FLERR,values[1]); + omega[m][2] = force->numeric(FLERR,values[2]); atomKK->modified(Host,OMEGA_MASK); return 3; } diff --git a/src/MOLECULE/atom_vec_angle.cpp b/src/MOLECULE/atom_vec_angle.cpp index 6eb5b50fd2..338ac2879e 100644 --- a/src/MOLECULE/atom_vec_angle.cpp +++ b/src/MOLECULE/atom_vec_angle.cpp @@ -793,7 +793,7 @@ void AtomVecAngle::data_atom(double *coord, imageint imagetmp, char **values) tag[nlocal] = ATOTAGINT(values[0]); molecule[nlocal] = ATOTAGINT(values[1]); - type[nlocal] = atoi(values[2]); + type[nlocal] = force->inumeric(FLERR,values[2]); if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); diff --git a/src/MOLECULE/atom_vec_bond.cpp b/src/MOLECULE/atom_vec_bond.cpp index 6a7b3585b4..96797bcd55 100644 --- a/src/MOLECULE/atom_vec_bond.cpp +++ b/src/MOLECULE/atom_vec_bond.cpp @@ -739,7 +739,7 @@ void AtomVecBond::data_atom(double *coord, imageint imagetmp, char **values) tag[nlocal] = ATOTAGINT(values[0]); molecule[nlocal] = ATOTAGINT(values[1]); - type[nlocal] = atoi(values[2]); + type[nlocal] = force->inumeric(FLERR,values[2]); if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); diff --git a/src/MOLECULE/atom_vec_full.cpp b/src/MOLECULE/atom_vec_full.cpp index d682abf799..bfd1864d6e 100644 --- a/src/MOLECULE/atom_vec_full.cpp +++ b/src/MOLECULE/atom_vec_full.cpp @@ -942,11 +942,11 @@ void AtomVecFull::data_atom(double *coord, imageint imagetmp, char **values) tag[nlocal] = ATOTAGINT(values[0]); molecule[nlocal] = ATOTAGINT(values[1]); - type[nlocal] = atoi(values[2]); + type[nlocal] = force->inumeric(FLERR,values[2]); if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); - q[nlocal] = atof(values[3]); + q[nlocal] = force->numeric(FLERR,values[3]); x[nlocal][0] = coord[0]; x[nlocal][1] = coord[1]; @@ -974,7 +974,7 @@ void AtomVecFull::data_atom(double *coord, imageint imagetmp, char **values) int AtomVecFull::data_atom_hybrid(int nlocal, char **values) { molecule[nlocal] = ATOTAGINT(values[0]); - q[nlocal] = atof(values[1]); + q[nlocal] = force->numeric(FLERR,values[1]); num_bond[nlocal] = 0; num_angle[nlocal] = 0; diff --git a/src/MOLECULE/atom_vec_molecular.cpp b/src/MOLECULE/atom_vec_molecular.cpp index cdd3f02505..7e4d4fadad 100644 --- a/src/MOLECULE/atom_vec_molecular.cpp +++ b/src/MOLECULE/atom_vec_molecular.cpp @@ -926,7 +926,7 @@ void AtomVecMolecular::data_atom(double *coord, imageint imagetmp, tag[nlocal] = ATOTAGINT(values[0]); molecule[nlocal] = ATOTAGINT(values[1]); - type[nlocal] = atoi(values[2]); + type[nlocal] = force->inumeric(FLERR,values[2]); if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); diff --git a/src/MOLECULE/atom_vec_template.cpp b/src/MOLECULE/atom_vec_template.cpp index 3172804b95..c856684330 100644 --- a/src/MOLECULE/atom_vec_template.cpp +++ b/src/MOLECULE/atom_vec_template.cpp @@ -745,8 +745,8 @@ void AtomVecTemplate::data_atom(double *coord, imageint imagetmp, char **values) error->one(FLERR,"Invalid atom ID in Atoms section of data file"); molecule[nlocal] = ATOTAGINT(values[1]); - molindex[nlocal] = atoi(values[2]) - 1; - molatom[nlocal] = atoi(values[3]) - 1; + molindex[nlocal] = force->inumeric(FLERR,values[2]) - 1; + molatom[nlocal] = force->inumeric(FLERR,values[3]) - 1; if (molindex[nlocal] < 0 || molindex[nlocal] >= nset) error->one(FLERR,"Invalid template index in Atoms section of data file"); @@ -754,7 +754,7 @@ void AtomVecTemplate::data_atom(double *coord, imageint imagetmp, char **values) molatom[nlocal] >= onemols[molindex[nlocal]]->natoms) error->one(FLERR,"Invalid template atom in Atoms section of data file"); - type[nlocal] = atoi(values[4]); + type[nlocal] = force->inumeric(FLERR,values[4]); if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); @@ -780,8 +780,8 @@ void AtomVecTemplate::data_atom(double *coord, imageint imagetmp, char **values) int AtomVecTemplate::data_atom_hybrid(int nlocal, char **values) { molecule[nlocal] = ATOTAGINT(values[0]); - molindex[nlocal] = atoi(values[1]) - 1; - molatom[nlocal] = atoi(values[2]) - 1; + molindex[nlocal] = force->inumeric(FLERR,values[1]) - 1; + molatom[nlocal] = force->inumeric(FLERR,values[2]) - 1; return 3; } diff --git a/src/PERI/atom_vec_peri.cpp b/src/PERI/atom_vec_peri.cpp index d78fe27c94..a8a94b86c9 100644 --- a/src/PERI/atom_vec_peri.cpp +++ b/src/PERI/atom_vec_peri.cpp @@ -792,12 +792,12 @@ void AtomVecPeri::data_atom(double *coord, imageint imagetmp, char **values) if (nlocal == nmax) grow(0); tag[nlocal] = ATOTAGINT(values[0]); - type[nlocal] = atoi(values[1]); + type[nlocal] = force->inumeric(FLERR,values[1]); if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); - vfrac[nlocal] = atof(values[2]); - rmass[nlocal] = atof(values[3]); + vfrac[nlocal] = force->numeric(FLERR,values[2]); + rmass[nlocal] = force->numeric(FLERR,values[3]); if (rmass[nlocal] <= 0.0) error->one(FLERR,"Invalid mass value"); x[nlocal][0] = coord[0]; @@ -826,8 +826,8 @@ void AtomVecPeri::data_atom(double *coord, imageint imagetmp, char **values) int AtomVecPeri::data_atom_hybrid(int nlocal, char **values) { - vfrac[nlocal] = atof(values[0]); - rmass[nlocal] = atof(values[1]); + vfrac[nlocal] = force->numeric(FLERR,values[0]); + rmass[nlocal] = force->numeric(FLERR,values[1]); if (rmass[nlocal] <= 0.0) error->one(FLERR,"Invalid mass value"); s0[nlocal] = DBL_MAX; diff --git a/src/SPIN/atom_vec_spin.cpp b/src/SPIN/atom_vec_spin.cpp index 37d6fb1e59..1d82114fe8 100644 --- a/src/SPIN/atom_vec_spin.cpp +++ b/src/SPIN/atom_vec_spin.cpp @@ -812,7 +812,7 @@ void AtomVecSpin::data_atom(double *coord, imageint imagetmp, char **values) if (nlocal == nmax) grow(0); tag[nlocal] = ATOTAGINT(values[0]); - type[nlocal] = atoi(values[1]); + type[nlocal] = force->inumeric(FLERR,values[1]); if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); @@ -820,10 +820,10 @@ void AtomVecSpin::data_atom(double *coord, imageint imagetmp, char **values) x[nlocal][1] = coord[1]; x[nlocal][2] = coord[2]; - sp[nlocal][3] = atof(values[2]); - sp[nlocal][0] = atof(values[6]); - sp[nlocal][1] = atof(values[7]); - sp[nlocal][2] = atof(values[8]); + sp[nlocal][3] = force->numeric(FLERR,values[2]); + sp[nlocal][0] = force->numeric(FLERR,values[6]); + sp[nlocal][1] = force->numeric(FLERR,values[7]); + sp[nlocal][2] = force->numeric(FLERR,values[8]); double inorm = 1.0/sqrt(sp[nlocal][0]*sp[nlocal][0] + sp[nlocal][1]*sp[nlocal][1] + sp[nlocal][2]*sp[nlocal][2]); @@ -849,16 +849,16 @@ void AtomVecSpin::data_atom(double *coord, imageint imagetmp, char **values) int AtomVecSpin::data_atom_hybrid(int nlocal, char **values) { - sp[nlocal][0] = atof(values[0]); - sp[nlocal][1] = atof(values[1]); - sp[nlocal][2] = atof(values[2]); + sp[nlocal][0] = force->numeric(FLERR,values[0]); + sp[nlocal][1] = force->numeric(FLERR,values[1]); + sp[nlocal][2] = force->numeric(FLERR,values[2]); double inorm = 1.0/sqrt(sp[nlocal][0]*sp[nlocal][0] + sp[nlocal][1]*sp[nlocal][1] + sp[nlocal][2]*sp[nlocal][2]); sp[nlocal][0] *= inorm; sp[nlocal][1] *= inorm; sp[nlocal][2] *= inorm; - sp[nlocal][3] = atof(values[3]); + sp[nlocal][3] = force->numeric(FLERR,values[3]); return 4; } diff --git a/src/USER-AWPMD/atom_vec_wavepacket.cpp b/src/USER-AWPMD/atom_vec_wavepacket.cpp index 7556dd2c8e..912544c860 100644 --- a/src/USER-AWPMD/atom_vec_wavepacket.cpp +++ b/src/USER-AWPMD/atom_vec_wavepacket.cpp @@ -916,19 +916,19 @@ void AtomVecWavepacket::data_atom(double *coord, imageint imagetmp, if (nlocal == nmax) grow(0); tag[nlocal] = ATOTAGINT(values[0]); - type[nlocal] = atoi(values[1]); + type[nlocal] = force->inumeric(FLERR,values[1]); if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); - q[nlocal] = atof(values[2]); - spin[nlocal] = atoi(values[3]); - eradius[nlocal] = atof(values[4]); + q[nlocal] = force->numeric(FLERR,values[2]); + spin[nlocal] = force->inumeric(FLERR,values[3]); + eradius[nlocal] = force->numeric(FLERR,values[4]); if (eradius[nlocal] < 0.0) error->one(FLERR,"Invalid eradius in Atoms section of data file"); - etag[nlocal] = atoi(values[5]); - cs[2*nlocal] = atoi(values[6]); - cs[2*nlocal+1] = atof(values[7]); + etag[nlocal] = force->inumeric(FLERR,values[5]); + cs[2*nlocal] = force->inumeric(FLERR,values[6]); + cs[2*nlocal+1] = force->numeric(FLERR,values[7]); x[nlocal][0] = coord[0]; x[nlocal][1] = coord[1]; @@ -952,15 +952,15 @@ void AtomVecWavepacket::data_atom(double *coord, imageint imagetmp, int AtomVecWavepacket::data_atom_hybrid(int nlocal, char **values) { - q[nlocal] = atof(values[0]); - spin[nlocal] = atoi(values[1]); - eradius[nlocal] = atof(values[2]); + q[nlocal] = force->numeric(FLERR,values[0]); + spin[nlocal] = force->inumeric(FLERR,values[1]); + eradius[nlocal] = force->numeric(FLERR,values[2]); if (eradius[nlocal] < 0.0) error->one(FLERR,"Invalid eradius in Atoms section of data file"); - etag[nlocal] = atoi(values[3]); - cs[2*nlocal] = atoi(values[4]); - cs[2*nlocal+1] = atof(values[5]); + etag[nlocal] = force->inumeric(FLERR,values[3]); + cs[2*nlocal] = force->inumeric(FLERR,values[4]); + cs[2*nlocal+1] = force->numeric(FLERR,values[5]); v[nlocal][0] = 0.0; v[nlocal][1] = 0.0; @@ -976,10 +976,10 @@ int AtomVecWavepacket::data_atom_hybrid(int nlocal, char **values) void AtomVecWavepacket::data_vel(int m, char **values) { - v[m][0] = atof(values[0]); - v[m][1] = atof(values[1]); - v[m][2] = atof(values[2]); - ervel[m] = atof(values[3]); + v[m][0] = force->numeric(FLERR,values[0]); + v[m][1] = force->numeric(FLERR,values[1]); + v[m][2] = force->numeric(FLERR,values[2]); + ervel[m] = force->numeric(FLERR,values[3]); } /* ---------------------------------------------------------------------- @@ -988,7 +988,7 @@ void AtomVecWavepacket::data_vel(int m, char **values) int AtomVecWavepacket::data_vel_hybrid(int m, char **values) { - ervel[m] = atof(values[0]); + ervel[m] = force->numeric(FLERR,values[0]); return 1; } diff --git a/src/USER-DPD/atom_vec_dpd.cpp b/src/USER-DPD/atom_vec_dpd.cpp index 4cf6356100..c67034baf2 100644 --- a/src/USER-DPD/atom_vec_dpd.cpp +++ b/src/USER-DPD/atom_vec_dpd.cpp @@ -814,11 +814,11 @@ void AtomVecDPD::data_atom(double *coord, tagint imagetmp, char **values) if (nlocal == nmax) grow(0); tag[nlocal] = ATOTAGINT(values[0]); - type[nlocal] = atoi(values[1]); + type[nlocal] = force->inumeric(FLERR,values[1]); if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); - dpdTheta[nlocal] = atof(values[2]); + dpdTheta[nlocal] = force->numeric(FLERR,values[2]); if (dpdTheta[nlocal] <= 0) error->one(FLERR,"Internal temperature in Atoms section of date file must be > zero"); @@ -850,7 +850,7 @@ void AtomVecDPD::data_atom(double *coord, tagint imagetmp, char **values) int AtomVecDPD::data_atom_hybrid(int nlocal, char **values) { - dpdTheta[nlocal] = atof(values[0]); + dpdTheta[nlocal] = force->numeric(FLERR,values[0]); return 1; } diff --git a/src/USER-EFF/atom_vec_electron.cpp b/src/USER-EFF/atom_vec_electron.cpp index 1bc5387c9e..2cf04e189a 100644 --- a/src/USER-EFF/atom_vec_electron.cpp +++ b/src/USER-EFF/atom_vec_electron.cpp @@ -799,15 +799,15 @@ void AtomVecElectron::data_atom(double *coord, imageint imagetmp, char **values) if (nlocal == nmax) grow(0); tag[nlocal] = ATOTAGINT(values[0]); - type[nlocal] = atoi(values[1]); + type[nlocal] = force->inumeric(FLERR,values[1]); if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); - q[nlocal] = atof(values[2]); - spin[nlocal] = atoi(values[3]); + q[nlocal] = force->numeric(FLERR,values[2]); + spin[nlocal] = force->inumeric(FLERR,values[3]); if (spin[nlocal] == 3) atom->ecp_flag = 1; - eradius[nlocal] = atof(values[4]); + eradius[nlocal] = force->numeric(FLERR,values[4]); x[nlocal][0] = coord[0]; x[nlocal][1] = coord[1]; @@ -831,9 +831,9 @@ void AtomVecElectron::data_atom(double *coord, imageint imagetmp, char **values) int AtomVecElectron::data_atom_hybrid(int nlocal, char **values) { - q[nlocal] = atof(values[0]); - spin[nlocal] = atoi(values[1]); - eradius[nlocal] = atof(values[2]); + q[nlocal] = force->numeric(FLERR,values[0]); + spin[nlocal] = force->inumeric(FLERR,values[1]); + eradius[nlocal] = force->numeric(FLERR,values[2]); if (eradius[nlocal] < 0.0) error->one(FLERR,"Invalid eradius in Atoms section of data file"); @@ -851,10 +851,10 @@ int AtomVecElectron::data_atom_hybrid(int nlocal, char **values) void AtomVecElectron::data_vel(int m, char **values) { - v[m][0] = atof(values[0]); - v[m][1] = atof(values[1]); - v[m][2] = atof(values[2]); - ervel[m] = atof(values[3]); + v[m][0] = force->numeric(FLERR,values[0]); + v[m][1] = force->numeric(FLERR,values[1]); + v[m][2] = force->numeric(FLERR,values[2]); + ervel[m] = force->numeric(FLERR,values[3]); } /* ---------------------------------------------------------------------- @@ -863,7 +863,7 @@ void AtomVecElectron::data_vel(int m, char **values) int AtomVecElectron::data_vel_hybrid(int m, char **values) { - ervel[m] = atof(values[0]); + ervel[m] = force->numeric(FLERR,values[0]); return 1; } diff --git a/src/USER-MESO/atom_vec_edpd.cpp b/src/USER-MESO/atom_vec_edpd.cpp index d956e914b5..b55573e409 100644 --- a/src/USER-MESO/atom_vec_edpd.cpp +++ b/src/USER-MESO/atom_vec_edpd.cpp @@ -759,12 +759,12 @@ void AtomVecEDPD::data_atom(double *coord, imageint imagetmp, char **values) if (nlocal == nmax) grow(0); tag[nlocal] = ATOTAGINT(values[0]); - type[nlocal] = atoi(values[1]); + type[nlocal] = force->inumeric(FLERR,values[1]); if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); - edpd_temp[nlocal] = atof(values[2]); - edpd_cv[nlocal] = atof(values[3]); + edpd_temp[nlocal] = force->numeric(FLERR,values[2]); + edpd_cv[nlocal] = force->numeric(FLERR,values[3]); x[nlocal][0] = coord[0]; x[nlocal][1] = coord[1]; diff --git a/src/USER-MESO/atom_vec_mdpd.cpp b/src/USER-MESO/atom_vec_mdpd.cpp index 5bc5e212ff..47082a3b82 100644 --- a/src/USER-MESO/atom_vec_mdpd.cpp +++ b/src/USER-MESO/atom_vec_mdpd.cpp @@ -798,7 +798,7 @@ void AtomVecMDPD::data_atom(double *coord, imageint imagetmp, char **values) { if (nlocal == nmax) grow(0); tag[nlocal] = ATOTAGINT(values[0]); - type[nlocal] = atoi(values[1]); + type[nlocal] = force->inumeric(FLERR,values[1]); if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); @@ -817,7 +817,7 @@ void AtomVecMDPD::data_atom(double *coord, imageint imagetmp, char **values) { vest[nlocal][1] = 0.0; vest[nlocal][2] = 0.0; - rho[nlocal] = atof(values[2]); + rho[nlocal] = force->numeric(FLERR,values[2]); drho[nlocal] = 0.0; atom->nlocal++; @@ -830,7 +830,7 @@ void AtomVecMDPD::data_atom(double *coord, imageint imagetmp, char **values) { int AtomVecMDPD::data_atom_hybrid(int nlocal, char **values) { - rho[nlocal] = atof(values[0]); + rho[nlocal] = force->numeric(FLERR,values[0]); return 3; } diff --git a/src/USER-MESO/atom_vec_tdpd.cpp b/src/USER-MESO/atom_vec_tdpd.cpp index aa0dc93809..261bef1795 100644 --- a/src/USER-MESO/atom_vec_tdpd.cpp +++ b/src/USER-MESO/atom_vec_tdpd.cpp @@ -792,7 +792,7 @@ void AtomVecTDPD::data_atom(double *coord, imageint imagetmp, char **values) if (nlocal == nmax) grow(0); tag[nlocal] = ATOTAGINT(values[0]); - type[nlocal] = atoi(values[1]); + type[nlocal] = force->inumeric(FLERR,values[1]); if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); diff --git a/src/USER-SMD/atom_vec_smd.cpp b/src/USER-SMD/atom_vec_smd.cpp index 020284312b..fb2b1ccc69 100644 --- a/src/USER-SMD/atom_vec_smd.cpp +++ b/src/USER-SMD/atom_vec_smd.cpp @@ -1029,7 +1029,7 @@ void AtomVecSMD::data_atom(double *coord, imageint imagetmp, char **values) { tag[nlocal] = ATOTAGINT(values[0]); - type[nlocal] = atoi(values[1]); + type[nlocal] = force->inumeric(FLERR,values[1]); if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes) error->one(FLERR, "Invalid atom type in Atoms section of data file"); @@ -1037,27 +1037,27 @@ void AtomVecSMD::data_atom(double *coord, imageint imagetmp, char **values) { if (molecule[nlocal] <= 0) error->one(FLERR, "Invalid molecule in Atoms section of data file"); - vfrac[nlocal] = atof(values[3]); + vfrac[nlocal] = force->numeric(FLERR,values[3]); if (vfrac[nlocal] < 0.0) error->one(FLERR, "Invalid volume in Atoms section of data file"); - rmass[nlocal] = atof(values[4]); + rmass[nlocal] = force->numeric(FLERR,values[4]); if (rmass[nlocal] == 0.0) error->one(FLERR, "Invalid mass in Atoms section of data file"); - radius[nlocal] = atof(values[5]); + radius[nlocal] = force->numeric(FLERR,values[5]); if (radius[nlocal] < 0.0) error->one(FLERR, "Invalid radius in Atoms section of data file"); - contact_radius[nlocal] = atof(values[6]); + contact_radius[nlocal] = force->numeric(FLERR,values[6]); if (contact_radius[nlocal] < 0.0) error->one(FLERR, "Invalid contact radius in Atoms section of data file"); e[nlocal] = 0.0; - x0[nlocal][0] = atof(values[7]); - x0[nlocal][1] = atof(values[8]); - x0[nlocal][2] = atof(values[9]); + x0[nlocal][0] = force->numeric(FLERR,values[7]); + x0[nlocal][1] = force->numeric(FLERR,values[8]); + x0[nlocal][2] = force->numeric(FLERR,values[9]); x[nlocal][0] = coord[0]; x[nlocal][1] = coord[1]; @@ -1108,12 +1108,12 @@ int AtomVecSMD::data_atom_hybrid(int /*nlocal*/, char **/*values*/) { ------------------------------------------------------------------------- */ void AtomVecSMD::data_vel(int m, char **values) { - v[m][0] = atof(values[0]); - v[m][1] = atof(values[1]); - v[m][2] = atof(values[2]); - vest[m][0] = atof(values[0]); - vest[m][1] = atof(values[1]); - vest[m][2] = atof(values[2]); + v[m][0] = force->numeric(FLERR,values[0]); + v[m][1] = force->numeric(FLERR,values[1]); + v[m][2] = force->numeric(FLERR,values[2]); + vest[m][0] = force->numeric(FLERR,values[0]); + vest[m][1] = force->numeric(FLERR,values[1]); + vest[m][2] = force->numeric(FLERR,values[2]); } /* ---------------------------------------------------------------------- diff --git a/src/USER-SPH/atom_vec_meso.cpp b/src/USER-SPH/atom_vec_meso.cpp index 7dc6c6f7bd..144eaa2433 100644 --- a/src/USER-SPH/atom_vec_meso.cpp +++ b/src/USER-SPH/atom_vec_meso.cpp @@ -843,13 +843,13 @@ void AtomVecMeso::data_atom(double *coord, imageint imagetmp, char **values) { if (nlocal == nmax) grow(0); tag[nlocal] = ATOTAGINT(values[0]); - type[nlocal] = atoi(values[1]); + type[nlocal] = force->inumeric(FLERR,values[1]); if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); - rho[nlocal] = atof(values[2]); - e[nlocal] = atof(values[3]); - cv[nlocal] = atof(values[4]); + rho[nlocal] = force->numeric(FLERR,values[2]); + e[nlocal] = force->numeric(FLERR,values[3]); + cv[nlocal] = force->numeric(FLERR,values[4]); x[nlocal][0] = coord[0]; x[nlocal][1] = coord[1]; @@ -881,9 +881,9 @@ void AtomVecMeso::data_atom(double *coord, imageint imagetmp, char **values) { int AtomVecMeso::data_atom_hybrid(int nlocal, char **values) { - rho[nlocal] = atof(values[0]); - e[nlocal] = atof(values[1]); - cv[nlocal] = atof(values[2]); + rho[nlocal] = force->numeric(FLERR,values[0]); + e[nlocal] = force->numeric(FLERR,values[1]); + cv[nlocal] = force->numeric(FLERR,values[2]); return 3; } diff --git a/src/atom_vec.cpp b/src/atom_vec.cpp index a7ca6fcb19..33caea05a2 100644 --- a/src/atom_vec.cpp +++ b/src/atom_vec.cpp @@ -113,9 +113,9 @@ int AtomVec::grow_nmax_bonus(int nmax_bonus) void AtomVec::data_vel(int m, char **values) { double **v = atom->v; - v[m][0] = atof(values[0]); - v[m][1] = atof(values[1]); - v[m][2] = atof(values[2]); + v[m][0] = force->numeric(FLERR,values[0]); + v[m][1] = force->numeric(FLERR,values[1]); + v[m][2] = force->numeric(FLERR,values[2]); } /* ---------------------------------------------------------------------- diff --git a/src/atom_vec_atomic.cpp b/src/atom_vec_atomic.cpp index e1c9a1e524..0f391baae9 100644 --- a/src/atom_vec_atomic.cpp +++ b/src/atom_vec_atomic.cpp @@ -612,7 +612,7 @@ void AtomVecAtomic::data_atom(double *coord, imageint imagetmp, char **values) if (nlocal == nmax) grow(0); tag[nlocal] = ATOTAGINT(values[0]); - type[nlocal] = atoi(values[1]); + type[nlocal] = force->inumeric(FLERR,values[1]); if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); diff --git a/src/atom_vec_body.cpp b/src/atom_vec_body.cpp index d5f286c077..f54605fbb0 100644 --- a/src/atom_vec_body.cpp +++ b/src/atom_vec_body.cpp @@ -1280,16 +1280,16 @@ void AtomVecBody::data_atom(double *coord, imageint imagetmp, char **values) if (nlocal == nmax) grow(0); tag[nlocal] = ATOTAGINT(values[0]); - type[nlocal] = atoi(values[1]); + type[nlocal] = force->inumeric(FLERR,values[1]); if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); - body[nlocal] = atoi(values[2]); + body[nlocal] = force->inumeric(FLERR,values[2]); if (body[nlocal] == 0) body[nlocal] = -1; else if (body[nlocal] == 1) body[nlocal] = 0; else error->one(FLERR,"Invalid bodyflag in Atoms section of data file"); - rmass[nlocal] = atof(values[3]); + rmass[nlocal] = force->numeric(FLERR,values[3]); if (rmass[nlocal] <= 0.0) error->one(FLERR,"Invalid density in Atoms section of data file"); @@ -1318,12 +1318,12 @@ void AtomVecBody::data_atom(double *coord, imageint imagetmp, char **values) int AtomVecBody::data_atom_hybrid(int nlocal, char **values) { - body[nlocal] = atoi(values[0]); + body[nlocal] = force->inumeric(FLERR,values[0]); if (body[nlocal] == 0) body[nlocal] = -1; else if (body[nlocal] == 1) body[nlocal] = 0; else error->one(FLERR,"Invalid atom type in Atoms section of data file"); - rmass[nlocal] = atof(values[1]); + rmass[nlocal] = force->numeric(FLERR,values[1]); if (rmass[nlocal] <= 0.0) error->one(FLERR,"Invalid density in Atoms section of data file"); @@ -1350,12 +1350,12 @@ void AtomVecBody::data_body(int m, int ninteger, int ndouble, void AtomVecBody::data_vel(int m, char **values) { - v[m][0] = atof(values[0]); - v[m][1] = atof(values[1]); - v[m][2] = atof(values[2]); - angmom[m][0] = atof(values[3]); - angmom[m][1] = atof(values[4]); - angmom[m][2] = atof(values[5]); + v[m][0] = force->numeric(FLERR,values[0]); + v[m][1] = force->numeric(FLERR,values[1]); + v[m][2] = force->numeric(FLERR,values[2]); + angmom[m][0] = force->numeric(FLERR,values[3]); + angmom[m][1] = force->numeric(FLERR,values[4]); + angmom[m][2] = force->numeric(FLERR,values[5]); } /* ---------------------------------------------------------------------- @@ -1364,9 +1364,9 @@ void AtomVecBody::data_vel(int m, char **values) int AtomVecBody::data_vel_hybrid(int m, char **values) { - angmom[m][0] = atof(values[0]); - angmom[m][1] = atof(values[1]); - angmom[m][2] = atof(values[2]); + angmom[m][0] = force->numeric(FLERR,values[0]); + angmom[m][1] = force->numeric(FLERR,values[1]); + angmom[m][2] = force->numeric(FLERR,values[2]); return 3; } diff --git a/src/atom_vec_charge.cpp b/src/atom_vec_charge.cpp index 440393385d..a6fd5962ca 100644 --- a/src/atom_vec_charge.cpp +++ b/src/atom_vec_charge.cpp @@ -663,11 +663,11 @@ void AtomVecCharge::data_atom(double *coord, imageint imagetmp, char **values) if (nlocal == nmax) grow(0); tag[nlocal] = ATOTAGINT(values[0]); - type[nlocal] = atoi(values[1]); + type[nlocal] = force->inumeric(FLERR,values[1]); if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); - q[nlocal] = atof(values[2]); + q[nlocal] = force->numeric(FLERR,values[2]); x[nlocal][0] = coord[0]; x[nlocal][1] = coord[1]; @@ -690,7 +690,7 @@ void AtomVecCharge::data_atom(double *coord, imageint imagetmp, char **values) int AtomVecCharge::data_atom_hybrid(int nlocal, char **values) { - q[nlocal] = atof(values[0]); + q[nlocal] = force->numeric(FLERR,values[0]); return 1; } diff --git a/src/atom_vec_ellipsoid.cpp b/src/atom_vec_ellipsoid.cpp index 2bf3f683d0..1fc713e583 100644 --- a/src/atom_vec_ellipsoid.cpp +++ b/src/atom_vec_ellipsoid.cpp @@ -1141,16 +1141,16 @@ void AtomVecEllipsoid::data_atom(double *coord, imageint imagetmp, if (nlocal == nmax) grow(0); tag[nlocal] = ATOTAGINT(values[0]); - type[nlocal] = atoi(values[1]); + type[nlocal] = force->inumeric(FLERR,values[1]); if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); - ellipsoid[nlocal] = atoi(values[2]); + ellipsoid[nlocal] = force->inumeric(FLERR,values[2]); if (ellipsoid[nlocal] == 0) ellipsoid[nlocal] = -1; else if (ellipsoid[nlocal] == 1) ellipsoid[nlocal] = 0; else error->one(FLERR,"Invalid ellipsoidflag in Atoms section of data file"); - rmass[nlocal] = atof(values[3]); + rmass[nlocal] = force->numeric(FLERR,values[3]); if (rmass[nlocal] <= 0.0) error->one(FLERR,"Invalid density in Atoms section of data file"); @@ -1178,12 +1178,12 @@ void AtomVecEllipsoid::data_atom(double *coord, imageint imagetmp, int AtomVecEllipsoid::data_atom_hybrid(int nlocal, char **values) { - ellipsoid[nlocal] = atoi(values[0]); + ellipsoid[nlocal] = force->inumeric(FLERR,values[0]); if (ellipsoid[nlocal] == 0) ellipsoid[nlocal] = -1; else if (ellipsoid[nlocal] == 1) ellipsoid[nlocal] = 0; else error->one(FLERR,"Invalid atom type in Atoms section of data file"); - rmass[nlocal] = atof(values[1]); + rmass[nlocal] = force->numeric(FLERR,values[1]); if (rmass[nlocal] <= 0.0) error->one(FLERR,"Invalid density in Atoms section of data file"); @@ -1202,17 +1202,17 @@ void AtomVecEllipsoid::data_atom_bonus(int m, char **values) if (nlocal_bonus == nmax_bonus) grow_bonus(); double *shape = bonus[nlocal_bonus].shape; - shape[0] = 0.5 * atof(values[0]); - shape[1] = 0.5 * atof(values[1]); - shape[2] = 0.5 * atof(values[2]); + shape[0] = 0.5 * force->numeric(FLERR,values[0]); + shape[1] = 0.5 * force->numeric(FLERR,values[1]); + shape[2] = 0.5 * force->numeric(FLERR,values[2]); if (shape[0] <= 0.0 || shape[1] <= 0.0 || shape[2] <= 0.0) error->one(FLERR,"Invalid shape in Ellipsoids section of data file"); double *quat = bonus[nlocal_bonus].quat; - quat[0] = atof(values[3]); - quat[1] = atof(values[4]); - quat[2] = atof(values[5]); - quat[3] = atof(values[6]); + quat[0] = force->numeric(FLERR,values[3]); + quat[1] = force->numeric(FLERR,values[4]); + quat[2] = force->numeric(FLERR,values[5]); + quat[3] = force->numeric(FLERR,values[6]); MathExtra::qnormalize(quat); // reset ellipsoid mass @@ -1230,12 +1230,12 @@ void AtomVecEllipsoid::data_atom_bonus(int m, char **values) void AtomVecEllipsoid::data_vel(int m, char **values) { - v[m][0] = atof(values[0]); - v[m][1] = atof(values[1]); - v[m][2] = atof(values[2]); - angmom[m][0] = atof(values[3]); - angmom[m][1] = atof(values[4]); - angmom[m][2] = atof(values[5]); + v[m][0] = force->numeric(FLERR,values[0]); + v[m][1] = force->numeric(FLERR,values[1]); + v[m][2] = force->numeric(FLERR,values[2]); + angmom[m][0] = force->numeric(FLERR,values[3]); + angmom[m][1] = force->numeric(FLERR,values[4]); + angmom[m][2] = force->numeric(FLERR,values[5]); } /* ---------------------------------------------------------------------- @@ -1244,9 +1244,9 @@ void AtomVecEllipsoid::data_vel(int m, char **values) int AtomVecEllipsoid::data_vel_hybrid(int m, char **values) { - angmom[m][0] = atof(values[0]); - angmom[m][1] = atof(values[1]); - angmom[m][2] = atof(values[2]); + angmom[m][0] = force->numeric(FLERR,values[0]); + angmom[m][1] = force->numeric(FLERR,values[1]); + angmom[m][2] = force->numeric(FLERR,values[2]); return 3; } diff --git a/src/atom_vec_hybrid.cpp b/src/atom_vec_hybrid.cpp index 7e1fb01e5d..cf99a90632 100644 --- a/src/atom_vec_hybrid.cpp +++ b/src/atom_vec_hybrid.cpp @@ -863,7 +863,7 @@ void AtomVecHybrid::data_atom(double *coord, imageint imagetmp, char **values) if (nlocal == nmax) grow(0); tag[nlocal] = ATOTAGINT(values[0]); - type[nlocal] = atoi(values[1]); + type[nlocal] = force->inumeric(FLERR,values[1]); if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); @@ -903,9 +903,9 @@ void AtomVecHybrid::data_atom(double *coord, imageint imagetmp, char **values) void AtomVecHybrid::data_vel(int m, char **values) { - v[m][0] = atof(values[0]); - v[m][1] = atof(values[1]); - v[m][2] = atof(values[2]); + v[m][0] = force->numeric(FLERR,values[0]); + v[m][1] = force->numeric(FLERR,values[1]); + v[m][2] = force->numeric(FLERR,values[2]); // each sub-style parses sub-style specific values diff --git a/src/atom_vec_line.cpp b/src/atom_vec_line.cpp index 020b622c93..f229297798 100644 --- a/src/atom_vec_line.cpp +++ b/src/atom_vec_line.cpp @@ -1037,16 +1037,16 @@ void AtomVecLine::data_atom(double *coord, imageint imagetmp, char **values) tag[nlocal] = ATOTAGINT(values[0]); molecule[nlocal] = ATOTAGINT(values[1]); - type[nlocal] = atoi(values[2]); + type[nlocal] = force->inumeric(FLERR,values[2]); if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); - line[nlocal] = atoi(values[3]); + line[nlocal] = force->inumeric(FLERR,values[3]); if (line[nlocal] == 0) line[nlocal] = -1; else if (line[nlocal] == 1) line[nlocal] = 0; else error->one(FLERR,"Invalid lineflag in Atoms section of data file"); - rmass[nlocal] = atof(values[4]); + rmass[nlocal] = force->numeric(FLERR,values[4]); if (rmass[nlocal] <= 0.0) error->one(FLERR,"Invalid density in Atoms section of data file"); @@ -1082,12 +1082,12 @@ int AtomVecLine::data_atom_hybrid(int nlocal, char **values) { molecule[nlocal] = ATOTAGINT(values[0]); - line[nlocal] = atoi(values[1]); + line[nlocal] = force->inumeric(FLERR,values[1]); if (line[nlocal] == 0) line[nlocal] = -1; else if (line[nlocal] == 1) line[nlocal] = 0; else error->one(FLERR,"Invalid atom type in Atoms section of data file"); - rmass[nlocal] = atof(values[2]); + rmass[nlocal] = force->numeric(FLERR,values[2]); if (rmass[nlocal] <= 0.0) error->one(FLERR,"Invalid density in Atoms section of data file"); @@ -1110,10 +1110,10 @@ void AtomVecLine::data_atom_bonus(int m, char **values) if (nlocal_bonus == nmax_bonus) grow_bonus(); - double x1 = atof(values[0]); - double y1 = atof(values[1]); - double x2 = atof(values[2]); - double y2 = atof(values[3]); + double x1 = force->numeric(FLERR,values[0]); + double y1 = force->numeric(FLERR,values[1]); + double x2 = force->numeric(FLERR,values[2]); + double y2 = force->numeric(FLERR,values[3]); double dx = x2 - x1; double dy = y2 - y1; double length = sqrt(dx*dx + dy*dy); @@ -1150,12 +1150,12 @@ void AtomVecLine::data_atom_bonus(int m, char **values) void AtomVecLine::data_vel(int m, char **values) { - v[m][0] = atof(values[0]); - v[m][1] = atof(values[1]); - v[m][2] = atof(values[2]); - omega[m][0] = atof(values[3]); - omega[m][1] = atof(values[4]); - omega[m][2] = atof(values[5]); + v[m][0] = force->numeric(FLERR,values[0]); + v[m][1] = force->numeric(FLERR,values[1]); + v[m][2] = force->numeric(FLERR,values[2]); + omega[m][0] = force->numeric(FLERR,values[3]); + omega[m][1] = force->numeric(FLERR,values[4]); + omega[m][2] = force->numeric(FLERR,values[5]); } /* ---------------------------------------------------------------------- @@ -1164,9 +1164,9 @@ void AtomVecLine::data_vel(int m, char **values) int AtomVecLine::data_vel_hybrid(int m, char **values) { - omega[m][0] = atof(values[0]); - omega[m][1] = atof(values[1]); - omega[m][2] = atof(values[2]); + omega[m][0] = force->numeric(FLERR,values[0]); + omega[m][1] = force->numeric(FLERR,values[1]); + omega[m][2] = force->numeric(FLERR,values[2]); return 3; } diff --git a/src/atom_vec_sphere.cpp b/src/atom_vec_sphere.cpp index dec98e5200..705b7411e7 100644 --- a/src/atom_vec_sphere.cpp +++ b/src/atom_vec_sphere.cpp @@ -965,15 +965,15 @@ void AtomVecSphere::data_atom(double *coord, imageint imagetmp, char **values) if (nlocal == nmax) grow(0); tag[nlocal] = ATOTAGINT(values[0]); - type[nlocal] = atoi(values[1]); + type[nlocal] = force->inumeric(FLERR,values[1]); if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); - radius[nlocal] = 0.5 * atof(values[2]); + radius[nlocal] = 0.5 * force->numeric(FLERR,values[2]); if (radius[nlocal] < 0.0) error->one(FLERR,"Invalid radius in Atoms section of data file"); - double density = atof(values[3]); + double density = force->numeric(FLERR,values[3]); if (density <= 0.0) error->one(FLERR,"Invalid density in Atoms section of data file"); @@ -1006,11 +1006,11 @@ void AtomVecSphere::data_atom(double *coord, imageint imagetmp, char **values) int AtomVecSphere::data_atom_hybrid(int nlocal, char **values) { - radius[nlocal] = 0.5 * atof(values[0]); + radius[nlocal] = 0.5 * force->numeric(FLERR,values[0]); if (radius[nlocal] < 0.0) error->one(FLERR,"Invalid radius in Atoms section of data file"); - double density = atof(values[1]); + double density = force->numeric(FLERR,values[1]); if (density <= 0.0) error->one(FLERR,"Invalid density in Atoms section of data file"); @@ -1028,12 +1028,12 @@ int AtomVecSphere::data_atom_hybrid(int nlocal, char **values) void AtomVecSphere::data_vel(int m, char **values) { - v[m][0] = atof(values[0]); - v[m][1] = atof(values[1]); - v[m][2] = atof(values[2]); - omega[m][0] = atof(values[3]); - omega[m][1] = atof(values[4]); - omega[m][2] = atof(values[5]); + v[m][0] = force->numeric(FLERR,values[0]); + v[m][1] = force->numeric(FLERR,values[1]); + v[m][2] = force->numeric(FLERR,values[2]); + omega[m][0] = force->numeric(FLERR,values[3]); + omega[m][1] = force->numeric(FLERR,values[4]); + omega[m][2] = force->numeric(FLERR,values[5]); } /* ---------------------------------------------------------------------- @@ -1042,9 +1042,9 @@ void AtomVecSphere::data_vel(int m, char **values) int AtomVecSphere::data_vel_hybrid(int m, char **values) { - omega[m][0] = atof(values[0]); - omega[m][1] = atof(values[1]); - omega[m][2] = atof(values[2]); + omega[m][0] = force->numeric(FLERR,values[0]); + omega[m][1] = force->numeric(FLERR,values[1]); + omega[m][2] = force->numeric(FLERR,values[2]); return 3; } diff --git a/src/atom_vec_tri.cpp b/src/atom_vec_tri.cpp index 8fbe0a92dc..9f4557b63d 100644 --- a/src/atom_vec_tri.cpp +++ b/src/atom_vec_tri.cpp @@ -1436,16 +1436,16 @@ void AtomVecTri::data_atom(double *coord, imageint imagetmp, char **values) tag[nlocal] = ATOTAGINT(values[0]); molecule[nlocal] = ATOTAGINT(values[1]); - type[nlocal] = atoi(values[2]); + type[nlocal] = force->inumeric(FLERR,values[2]); if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes) error->one(FLERR,"Invalid atom type in Atoms section of data file"); - tri[nlocal] = atoi(values[3]); + tri[nlocal] = force->inumeric(FLERR,values[3]); if (tri[nlocal] == 0) tri[nlocal] = -1; else if (tri[nlocal] == 1) tri[nlocal] = 0; else error->one(FLERR,"Invalid triflag in Atoms section of data file"); - rmass[nlocal] = atof(values[4]); + rmass[nlocal] = force->numeric(FLERR,values[4]); if (rmass[nlocal] <= 0.0) error->one(FLERR,"Invalid density in Atoms section of data file"); @@ -1484,12 +1484,12 @@ int AtomVecTri::data_atom_hybrid(int nlocal, char **values) { molecule[nlocal] = ATOTAGINT(values[0]); - tri[nlocal] = atoi(values[1]); + tri[nlocal] = force->inumeric(FLERR,values[1]); if (tri[nlocal] == 0) tri[nlocal] = -1; else if (tri[nlocal] == 1) tri[nlocal] = 0; else error->one(FLERR,"Invalid atom type in Atoms section of data file"); - rmass[nlocal] = atof(values[2]); + rmass[nlocal] = force->numeric(FLERR,values[2]); if (rmass[nlocal] <= 0.0) error->one(FLERR,"Invalid density in Atoms section of data file"); @@ -1513,15 +1513,15 @@ void AtomVecTri::data_atom_bonus(int m, char **values) if (nlocal_bonus == nmax_bonus) grow_bonus(); double c1[3],c2[3],c3[3]; - c1[0] = atof(values[0]); - c1[1] = atof(values[1]); - c1[2] = atof(values[2]); - c2[0] = atof(values[3]); - c2[1] = atof(values[4]); - c2[2] = atof(values[5]); - c3[0] = atof(values[6]); - c3[1] = atof(values[7]); - c3[2] = atof(values[8]); + c1[0] = force->numeric(FLERR,values[0]); + c1[1] = force->numeric(FLERR,values[1]); + c1[2] = force->numeric(FLERR,values[2]); + c2[0] = force->numeric(FLERR,values[3]); + c2[1] = force->numeric(FLERR,values[4]); + c2[2] = force->numeric(FLERR,values[5]); + c3[0] = force->numeric(FLERR,values[6]); + c3[1] = force->numeric(FLERR,values[7]); + c3[2] = force->numeric(FLERR,values[8]); // check for duplicate points @@ -1641,15 +1641,15 @@ void AtomVecTri::data_atom_bonus(int m, char **values) void AtomVecTri::data_vel(int m, char **values) { - v[m][0] = atof(values[0]); - v[m][1] = atof(values[1]); - v[m][2] = atof(values[2]); - omega[m][0] = atof(values[3]); - omega[m][1] = atof(values[4]); - omega[m][2] = atof(values[5]); - angmom[m][0] = atof(values[6]); - angmom[m][1] = atof(values[7]); - angmom[m][2] = atof(values[8]); + v[m][0] = force->numeric(FLERR,values[0]); + v[m][1] = force->numeric(FLERR,values[1]); + v[m][2] = force->numeric(FLERR,values[2]); + omega[m][0] = force->numeric(FLERR,values[3]); + omega[m][1] = force->numeric(FLERR,values[4]); + omega[m][2] = force->numeric(FLERR,values[5]); + angmom[m][0] = force->numeric(FLERR,values[6]); + angmom[m][1] = force->numeric(FLERR,values[7]); + angmom[m][2] = force->numeric(FLERR,values[8]); } /* ---------------------------------------------------------------------- @@ -1658,12 +1658,12 @@ void AtomVecTri::data_vel(int m, char **values) int AtomVecTri::data_vel_hybrid(int m, char **values) { - omega[m][0] = atof(values[0]); - omega[m][1] = atof(values[1]); - omega[m][2] = atof(values[2]); - angmom[m][0] = atof(values[3]); - angmom[m][1] = atof(values[4]); - angmom[m][2] = atof(values[5]); + omega[m][0] = force->numeric(FLERR,values[0]); + omega[m][1] = force->numeric(FLERR,values[1]); + omega[m][2] = force->numeric(FLERR,values[2]); + angmom[m][0] = force->numeric(FLERR,values[3]); + angmom[m][1] = force->numeric(FLERR,values[4]); + angmom[m][2] = force->numeric(FLERR,values[5]); return 6; }