Unverified Commit a1a77549 authored by Axel Kohlmeyer's avatar Axel Kohlmeyer Committed by GitHub
Browse files

Merge pull request #1559 from akohlmey/validate-more-data-file-numbers

Complete data file read validation change set
parents 0eba1c1c 054ff97a
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -781,7 +781,7 @@ void AtomVecDipole::data_atom(double *coord, imageint imagetmp, char **values)
  int nlocal = atom->nlocal;
  if (nlocal == nmax) grow(0);

  tag[nlocal] = ATOTAGINT(values[0]);
  tag[nlocal] = utils::tnumeric(FLERR,values[0],true,lmp);
  type[nlocal] = utils::inumeric(FLERR,values[1],true,lmp);
  if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
    error->one(FLERR,"Invalid atom type in Atoms section of data file");
+1 −1
Original line number Diff line number Diff line
@@ -1724,7 +1724,7 @@ void AtomVecDPDKokkos::data_atom(double *coord, tagint imagetmp,
  int nlocal = atom->nlocal;
  if (nlocal == nmax) grow(0);

  h_tag[nlocal] = ATOTAGINT(values[0]);
  h_tag[nlocal] = utils::tnumeric(FLERR,values[0],true,lmp);
  h_type[nlocal] = utils::inumeric(FLERR,values[1],true,lmp);
  if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
    error->one(FLERR,"Invalid atom type in Atoms section of data file");
+1 −1
Original line number Diff line number Diff line
@@ -976,7 +976,7 @@ void AtomVecHybridKokkos::data_atom(double *coord, imageint imagetmp, char **val
  int nlocal = atom->nlocal;
  if (nlocal == nmax) grow(0);

  h_tag[nlocal] = ATOTAGINT(values[0]);
  h_tag[nlocal] = utils::tnumeric(FLERR,values[0],true,lmp);
  h_type[nlocal] = utils::inumeric(FLERR,values[1],true,lmp);
  if (h_type[nlocal] <= 0 || h_type[nlocal] > atom->ntypes)
    error->one(FLERR,"Invalid atom h_type in Atoms section of data file");
+1 −1
Original line number Diff line number Diff line
@@ -2549,7 +2549,7 @@ void AtomVecSphereKokkos::data_atom(double *coord, imageint imagetmp, char **val
  int nlocal = atom->nlocal;
  if (nlocal == nmax) grow(0);

  tag[nlocal] = ATOTAGINT(values[0]);
  tag[nlocal] = utils::tnumeric(FLERR,values[0],true,lmp);
  type[nlocal] = utils::inumeric(FLERR,values[1],true,lmp);
  if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
    error->one(FLERR,"Invalid atom type in Atoms section of data file");
+3 −3
Original line number Diff line number Diff line
@@ -793,8 +793,8 @@ void AtomVecAngle::data_atom(double *coord, imageint imagetmp, char **values)
  int nlocal = atom->nlocal;
  if (nlocal == nmax) grow(0);

  tag[nlocal] = ATOTAGINT(values[0]);
  molecule[nlocal] = ATOTAGINT(values[1]);
  tag[nlocal] = utils::tnumeric(FLERR,values[0],true,lmp);
  molecule[nlocal] = utils::tnumeric(FLERR,values[1],true,lmp);
  type[nlocal] = utils::inumeric(FLERR,values[2],true,lmp);
  if (type[nlocal] <= 0 || type[nlocal] > atom->ntypes)
    error->one(FLERR,"Invalid atom type in Atoms section of data file");
@@ -822,7 +822,7 @@ void AtomVecAngle::data_atom(double *coord, imageint imagetmp, char **values)

int AtomVecAngle::data_atom_hybrid(int nlocal, char **values)
{
  molecule[nlocal] = ATOTAGINT(values[0]);
  molecule[nlocal] = utils::tnumeric(FLERR,values[0],true,lmp);

  num_bond[nlocal] = 0;
  num_angle[nlocal] = 0;
Loading