From 3b9d5916c95ef1230e8b25611d8b600c54cb8889 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 16 Mar 2021 16:38:56 -0400 Subject: [PATCH] add backward compatibility for recent changes to KIM commands --- src/deprecated.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/deprecated.cpp b/src/deprecated.cpp index 8523cf353a..40974e202b 100644 --- a/src/deprecated.cpp +++ b/src/deprecated.cpp @@ -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_' has been renamed to 'kim '\n\n"); + utils::logmesg(lmp,"\nWARNING: 'kim_' has been renamed to " + "'kim '. 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"); }