Use utils::logical() to parse arguments.
This commit is contained in:
@ -240,13 +240,8 @@ void PairSW::settings(int narg, char ** arg)
|
||||
while (iarg < narg) {
|
||||
if (strcmp(arg[iarg],"threebody") == 0) {
|
||||
if (iarg+2 > narg) error->all(FLERR,"Illegal pair_style command");
|
||||
if (strcmp(arg[iarg+1], "on") == 0) {
|
||||
threebody_flag = true;
|
||||
one_coeff = 1;
|
||||
} else if (strcmp(arg[iarg+1], "off") == 0) {
|
||||
threebody_flag = false;
|
||||
one_coeff = 0; // Allow for multiple pair_coeff's
|
||||
} else error->all(FLERR,"Illegal pair_style command");
|
||||
threebody_flag = utils::logical(FLERR,arg[iarg+1],false,lmp);
|
||||
one_coeff = threebody_flag;
|
||||
iarg += 2;
|
||||
} else error->all(FLERR,"Illegal pair_style command");
|
||||
}
|
||||
|
||||
@ -48,11 +48,11 @@ class PairSW : public Pair {
|
||||
};
|
||||
|
||||
protected:
|
||||
double cutmax; // max cutoff for all elements
|
||||
Param *params; // parameter set for an I-J-K interaction
|
||||
int maxshort; // size of short neighbor list array
|
||||
int *neighshort; // short neighbor list array
|
||||
bool threebody_flag; // whether to run threebody loop
|
||||
double cutmax; // max cutoff for all elements
|
||||
Param *params; // parameter set for an I-J-K interaction
|
||||
int maxshort; // size of short neighbor list array
|
||||
int *neighshort; // short neighbor list array
|
||||
int threebody_flag; // whether to run threebody loop
|
||||
|
||||
void settings(int, char **) override;
|
||||
virtual void allocate();
|
||||
|
||||
Reference in New Issue
Block a user