remove redundant error argument (accessible through lmp)
This commit is contained in:
@ -92,9 +92,9 @@ FixAdaptFEP::FixAdaptFEP(LAMMPS *lmp, int narg, char **arg) :
|
||||
adapt[nadapt].pstyle = utils::strdup(arg[iarg+1]);
|
||||
adapt[nadapt].pparam = utils::strdup(arg[iarg+2]);
|
||||
utils::bounds_typelabel(FLERR, arg[iarg+3], 1, atom->ntypes,
|
||||
adapt[nadapt].ilo, adapt[nadapt].ihi, error, lmp, Atom::ATOM);
|
||||
adapt[nadapt].ilo, adapt[nadapt].ihi, lmp, Atom::ATOM);
|
||||
utils::bounds_typelabel(FLERR, arg[iarg+4], 1, atom->ntypes,
|
||||
adapt[nadapt].jlo, adapt[nadapt].jhi, error, lmp, Atom::ATOM);
|
||||
adapt[nadapt].jlo, adapt[nadapt].jhi, lmp, Atom::ATOM);
|
||||
|
||||
// switch i,j if i > j, if wildcards were not used
|
||||
|
||||
@ -131,7 +131,7 @@ FixAdaptFEP::FixAdaptFEP(LAMMPS *lmp, int narg, char **arg) :
|
||||
chgflag = 1;
|
||||
} else error->all(FLERR,"Illegal fix adapt/fep command");
|
||||
utils::bounds_typelabel(FLERR, arg[iarg+2], 1, atom->ntypes,
|
||||
adapt[nadapt].ilo, adapt[nadapt].ihi, error, lmp, Atom::ATOM);
|
||||
adapt[nadapt].ilo, adapt[nadapt].ihi, lmp, Atom::ATOM);
|
||||
if (utils::strmatch(arg[iarg+3],"^v_")) {
|
||||
adapt[nadapt].var = utils::strdup(arg[iarg+3]+2);
|
||||
} else error->all(FLERR,"Illegal fix adapt/fep command");
|
||||
|
||||
@ -1995,7 +1995,7 @@ void Atom::set_mass(const char *file, int line, int /*narg*/, char **arg)
|
||||
error->all(file,line, "Cannot set per-type atom mass for atom style {}", atom_style);
|
||||
|
||||
int lo, hi;
|
||||
utils::bounds_typelabel(file, line, arg[0], 1, ntypes, lo, hi, error, lmp, Atom::ATOM);
|
||||
utils::bounds_typelabel(file, line, arg[0], 1, ntypes, lo, hi, lmp, Atom::ATOM);
|
||||
if ((lo < 1) || (hi > ntypes))
|
||||
error->all(file, line, "Invalid atom type {} for atom mass", arg[0]);
|
||||
|
||||
|
||||
@ -102,8 +102,8 @@ ComputeRDF::ComputeRDF(LAMMPS *lmp, int narg, char **arg) :
|
||||
} else {
|
||||
iarg = 4;
|
||||
for (int ipair = 0; ipair < npairs; ipair++) {
|
||||
utils::bounds_typelabel(FLERR, arg[iarg], 1, atom->ntypes, ilo[ipair], ihi[ipair], error, lmp, Atom::ATOM);
|
||||
utils::bounds_typelabel(FLERR, arg[iarg+1], 1, atom->ntypes, jlo[ipair], jhi[ipair], error, lmp, Atom::ATOM);
|
||||
utils::bounds_typelabel(FLERR, arg[iarg], 1, atom->ntypes, ilo[ipair], ihi[ipair], lmp, Atom::ATOM);
|
||||
utils::bounds_typelabel(FLERR, arg[iarg+1], 1, atom->ntypes, jlo[ipair], jhi[ipair], lmp, Atom::ATOM);
|
||||
|
||||
// switch i,j if i > j, if wildcards were not used
|
||||
|
||||
|
||||
@ -100,9 +100,9 @@ FixAdapt::FixAdapt(LAMMPS *lmp, int narg, char **arg) :
|
||||
adapt[nadapt].pstyle = utils::strdup(arg[iarg+1]);
|
||||
adapt[nadapt].pparam = utils::strdup(arg[iarg+2]);
|
||||
utils::bounds_typelabel(FLERR, arg[iarg+3], 1, atom->ntypes,
|
||||
adapt[nadapt].ilo, adapt[nadapt].ihi, error, lmp, Atom::ATOM);
|
||||
adapt[nadapt].ilo, adapt[nadapt].ihi, lmp, Atom::ATOM);
|
||||
utils::bounds_typelabel(FLERR, arg[iarg+4], 1, atom->ntypes,
|
||||
adapt[nadapt].jlo, adapt[nadapt].jhi, error, lmp, Atom::ATOM);
|
||||
adapt[nadapt].jlo, adapt[nadapt].jhi, lmp, Atom::ATOM);
|
||||
|
||||
// switch i,j if i > j, if wildcards were not used
|
||||
|
||||
@ -127,7 +127,7 @@ FixAdapt::FixAdapt(LAMMPS *lmp, int narg, char **arg) :
|
||||
adapt[nadapt].bstyle = utils::strdup(arg[iarg+1]);
|
||||
adapt[nadapt].bparam = utils::strdup(arg[iarg+2]);
|
||||
utils::bounds_typelabel(FLERR, arg[iarg+3], 1, atom->nbondtypes,
|
||||
adapt[nadapt].ilo, adapt[nadapt].ihi, error, lmp, Atom::BOND);
|
||||
adapt[nadapt].ilo, adapt[nadapt].ihi, lmp, Atom::BOND);
|
||||
if (utils::strmatch(arg[iarg+4],"^v_")) {
|
||||
adapt[nadapt].var = utils::strdup(arg[iarg+4]+2);
|
||||
} else error->all(FLERR,"Argument #{} must be variable not {}", iarg+5, arg[iarg+4]);
|
||||
@ -140,7 +140,7 @@ FixAdapt::FixAdapt(LAMMPS *lmp, int narg, char **arg) :
|
||||
adapt[nadapt].astyle = utils::strdup(arg[iarg+1]);
|
||||
adapt[nadapt].aparam = utils::strdup(arg[iarg+2]);
|
||||
utils::bounds_typelabel(FLERR, arg[iarg+3], 1, atom->nangletypes,
|
||||
adapt[nadapt].ilo, adapt[nadapt].ihi, error, lmp, Atom::ANGLE);
|
||||
adapt[nadapt].ilo, adapt[nadapt].ihi, lmp, Atom::ANGLE);
|
||||
if (utils::strmatch(arg[iarg+4],"^v_")) {
|
||||
adapt[nadapt].var = utils::strdup(arg[iarg+4]+2);
|
||||
} else error->all(FLERR,"Argument #{} must be variable not {}", iarg+5, arg[iarg+4]);
|
||||
|
||||
@ -740,7 +740,7 @@ void Set::selection(int n)
|
||||
else select[i] = 0;
|
||||
|
||||
} else if (style == TYPE_SELECT) {
|
||||
utils::bounds_typelabel(FLERR,id,1,atom->ntypes,nlo,nhi,error,lmp,Atom::ATOM);
|
||||
utils::bounds_typelabel(FLERR,id,1,atom->ntypes,nlo,nhi,lmp,Atom::ATOM);
|
||||
|
||||
int *type = atom->type;
|
||||
for (int i = 0; i < n; i++)
|
||||
|
||||
@ -655,7 +655,7 @@ template void utils::bounds<>(const char *, int, const std::string &,
|
||||
|
||||
template <typename TYPE>
|
||||
void utils::bounds_typelabel(const char *file, int line, const std::string &str, bigint nmin,
|
||||
bigint nmax, TYPE &nlo, TYPE &nhi, Error *error, LAMMPS *lmp, int mode)
|
||||
bigint nmax, TYPE &nlo, TYPE &nhi, LAMMPS *lmp, int mode)
|
||||
{
|
||||
nlo = nhi = -1;
|
||||
char *typestr;
|
||||
@ -665,15 +665,15 @@ void utils::bounds_typelabel(const char *file, int line, const std::string &str,
|
||||
if (nlo > -1)
|
||||
return;
|
||||
else
|
||||
utils::bounds(file, line, str, nmin, nmax, nlo, nhi, error);
|
||||
utils::bounds(file, line, str, nmin, nmax, nlo, nhi, lmp->error);
|
||||
}
|
||||
|
||||
template void utils::bounds_typelabel<>(const char *, int, const std::string &, bigint, bigint,
|
||||
int &, int &, Error *, LAMMPS *, int);
|
||||
int &, int &, LAMMPS *, int);
|
||||
template void utils::bounds_typelabel<>(const char *, int, const std::string &, bigint, bigint,
|
||||
long &, long &, Error *, LAMMPS *, int);
|
||||
long &, long &, LAMMPS *, int);
|
||||
template void utils::bounds_typelabel<>(const char *, int, const std::string &, bigint, bigint,
|
||||
long long &, long long &, Error *, LAMMPS *, int);
|
||||
long long &, long long &, LAMMPS *, int);
|
||||
|
||||
/* -------------------------------------------------------------------------
|
||||
Expand list of arguments in arg to earg if arg contains wildcards
|
||||
|
||||
@ -341,8 +341,8 @@ namespace utils {
|
||||
* \param mode select labelmap using constants from Atom class */
|
||||
|
||||
template <typename TYPE>
|
||||
void bounds_typelabel(const char *file, int line, const std::string &str, bigint nmin, bigint nmax,
|
||||
TYPE &nlo, TYPE &nhi, Error *error, LAMMPS *lmp, int mode);
|
||||
void bounds_typelabel(const char *file, int line, const std::string &str, bigint nmin,
|
||||
bigint nmax, TYPE &nlo, TYPE &nhi, LAMMPS *lmp, int mode);
|
||||
|
||||
/*! Expand list of arguments when containing fix/compute wildcards
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user