This commit is contained in:
Axel Kohlmeyer
2023-03-11 17:45:48 -05:00
parent 6b6f8087d3
commit cf6f6829ae

View File

@ -85,13 +85,15 @@ FixEfield::FixEfield(LAMMPS *lmp, int narg, char **arg) :
int iarg = 6; int iarg = 6;
while (iarg < narg) { while (iarg < narg) {
if (strcmp(arg[iarg], "region") == 0) { if (strcmp(arg[iarg], "region") == 0) {
if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, std::string("fix ") + style + " region", error); if (iarg + 2 > narg)
utils::missing_cmd_args(FLERR, std::string("fix ") + style + " region", error);
region = domain->get_region_by_id(arg[iarg + 1]); region = domain->get_region_by_id(arg[iarg + 1]);
if (!region) error->all(FLERR, "Region {} for fix efield does not exist", arg[iarg + 1]); if (!region) error->all(FLERR, "Region {} for fix efield does not exist", arg[iarg + 1]);
idregion = utils::strdup(arg[iarg + 1]); idregion = utils::strdup(arg[iarg + 1]);
iarg += 2; iarg += 2;
} else if (strcmp(arg[iarg], "energy") == 0) { } else if (strcmp(arg[iarg], "energy") == 0) {
if (iarg + 2 > narg) utils::missing_cmd_args(FLERR, std::string("fix ") + style + "energy", error); if (iarg + 2 > narg)
utils::missing_cmd_args(FLERR, std::string("fix ") + style + "energy", error);
if (utils::strmatch(arg[iarg + 1], "^v_")) { if (utils::strmatch(arg[iarg + 1], "^v_")) {
estr = utils::strdup(arg[iarg + 1] + 2); estr = utils::strdup(arg[iarg + 1] + 2);
} else } else