add backward compatibility for recent changes to KIM commands

This commit is contained in:
Axel Kohlmeyer
2021-03-16 16:38:56 -04:00
parent 3304dfcbfe
commit 3b9d5916c9

View File

@ -25,7 +25,7 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
void Deprecated::command(int /* narg */, char ** /* arg */)
void Deprecated::command(int narg, char **arg)
{
const std::string cmd = input->command;
@ -38,7 +38,15 @@ void Deprecated::command(int /* narg */, char ** /* arg */)
utils::logmesg(lmp,"\n'reset_ids' has been renamed to 'reset_atom_ids'\n\n");
} else if (utils::strmatch(cmd,"^kim_")) {
if (lmp->comm->me == 0)
utils::logmesg(lmp,"\n'kim_<command>' has been renamed to 'kim <command>'\n\n");
utils::logmesg(lmp,"\nWARNING: 'kim_<command>' has been renamed to "
"'kim <command>'. Please update your input.\n\n");
std::string newcmd("kim");
newcmd += " " + cmd.substr(4);
for (int i=0; i < narg; ++i) {
newcmd.append(1,' ');
newcmd.append(arg[i]);
}
input->one(newcmd);
}
error->all(FLERR,"This command is no longer available");
}