modernize parsing of Velocities section of data files

This commit is contained in:
Axel Kohlmeyer
2021-12-30 19:02:52 -05:00
parent def1072f0f
commit 8d53cd1e5d
9 changed files with 41 additions and 45 deletions

View File

@ -1890,18 +1890,18 @@ void AtomVec::write_data(FILE *fp, int n, double **buf)
unpack one line from Velocities section of data file
------------------------------------------------------------------------- */
void AtomVec::data_vel(int ilocal, char **values)
void AtomVec::data_vel(int ilocal, const std::vector<std::string> &values)
{
int m,n,datatype,cols;
void *pdata;
double **v = atom->v;
v[ilocal][0] = utils::numeric(FLERR,values[0],true,lmp);
v[ilocal][1] = utils::numeric(FLERR,values[1],true,lmp);
v[ilocal][2] = utils::numeric(FLERR,values[2],true,lmp);
int ivalue = 1;
v[ilocal][0] = utils::numeric(FLERR,values[ivalue++],true,lmp);
v[ilocal][1] = utils::numeric(FLERR,values[ivalue++],true,lmp);
v[ilocal][2] = utils::numeric(FLERR,values[ivalue++],true,lmp);
if (ndata_vel > 2) {
int ivalue = 3;
for (n = 2; n < ndata_vel; n++) {
pdata = mdata_vel.pdata[n];
datatype = mdata_vel.datatype[n];