apply new utility function to most places creating new styles

This commit is contained in:
Axel Kohlmeyer
2019-04-07 20:55:39 -04:00
parent 9166001041
commit d640c712f8
9 changed files with 26 additions and 38 deletions

View File

@ -893,11 +893,8 @@ void Modify::add_fix(int narg, char **arg, int trysuffix)
fix[ifix] = fix_creator(lmp,narg,arg);
}
if (fix[ifix] == NULL) {
char str[128];
snprintf(str,128,"Unknown fix style %s",arg[2]);
error->all(FLERR,str);
}
if (fix[ifix] == NULL)
error->all(FLERR,utils::check_packages_for_style("fix",arg[2],lmp).c_str());
// check if Fix is in restart_global list
// if yes, pass state info to the Fix so it can reset itself
@ -1195,11 +1192,8 @@ void Modify::add_compute(int narg, char **arg, int trysuffix)
compute[ncompute] = compute_creator(lmp,narg,arg);
}
if (compute[ncompute] == NULL) {
char str[128];
snprintf(str,128,"Unknown compute style %s",arg[2]);
error->all(FLERR,str);
}
if (compute[ncompute] == NULL)
error->all(FLERR,utils::check_packages_for_style("compute",arg[2],lmp).c_str());
ncompute++;
}