modernize

This commit is contained in:
Axel Kohlmeyer
2024-03-02 15:53:33 -05:00
parent 45e8ee1c08
commit ccdf55151d

View File

@ -46,7 +46,7 @@ ComputeRDF::ComputeRDF(LAMMPS *lmp, int narg, char **arg) :
hist(nullptr), histall(nullptr), typecount(nullptr), icount(nullptr), jcount(nullptr), hist(nullptr), histall(nullptr), typecount(nullptr), icount(nullptr), jcount(nullptr),
duplicates(nullptr) duplicates(nullptr)
{ {
if (narg < 4) error->all(FLERR,"Illegal compute rdf command"); if (narg < 4) utils::missing_cmd_args(FLERR,"compute rdf", error);
array_flag = 1; array_flag = 1;
extarray = 0; extarray = 0;
@ -67,14 +67,14 @@ ComputeRDF::ComputeRDF(LAMMPS *lmp, int narg, char **arg) :
while (iarg < narg) { while (iarg < narg) {
if (strcmp(arg[iarg],"cutoff") == 0) { if (strcmp(arg[iarg],"cutoff") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal compute rdf command"); if (iarg+2 > narg) utils::missing_cmd_args(FLERR,"compute rdf cutoff", error);
if ((neighbor->style == Neighbor::MULTI) || (neighbor->style == Neighbor::MULTI_OLD)) if ((neighbor->style == Neighbor::MULTI) || (neighbor->style == Neighbor::MULTI_OLD))
error->all(FLERR, "Compute rdf with custom cutoff requires neighbor style 'bin' or 'nsq'"); error->all(FLERR, "Compute rdf with custom cutoff requires neighbor style 'bin' or 'nsq'");
cutoff_user = utils::numeric(FLERR,arg[iarg+1],false,lmp); cutoff_user = utils::numeric(FLERR,arg[iarg+1],false,lmp);
if (cutoff_user <= 0.0) cutflag = 0; if (cutoff_user <= 0.0) cutflag = 0;
else cutflag = 1; else cutflag = 1;
iarg += 2; iarg += 2;
} else error->all(FLERR,"Illegal compute rdf command"); } else error->all(FLERR,"Unknown compute rdf keyword {}", arg[iarg]);
} }
// pairwise args // pairwise args
@ -160,8 +160,7 @@ void ComputeRDF::init()
{ {
if (!force->pair && !cutflag) if (!force->pair && !cutflag)
error->all(FLERR,"Compute rdf requires a pair style be defined " error->all(FLERR,"Compute rdf requires a pair style or an explicit cutoff");
"or cutoff specified");
if (cutflag) { if (cutflag) {
double skin = neighbor->skin; double skin = neighbor->skin;