diff --git a/src/MANYBODY/pair_sw.cpp b/src/MANYBODY/pair_sw.cpp index 0564f9be2b..4d6080c146 100644 --- a/src/MANYBODY/pair_sw.cpp +++ b/src/MANYBODY/pair_sw.cpp @@ -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"); } diff --git a/src/MANYBODY/pair_sw.h b/src/MANYBODY/pair_sw.h index 76d1bbc202..40d3568fb4 100644 --- a/src/MANYBODY/pair_sw.h +++ b/src/MANYBODY/pair_sw.h @@ -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();