diff --git a/src/deprecated.cpp b/src/deprecated.cpp index ed9a9e6de4c90f2b3adeda12e93eeb1ab75dd33d..2f2282f07c049300c6f2de58b88fc264d9256556 100644 --- a/src/deprecated.cpp +++ b/src/deprecated.cpp @@ -38,11 +38,8 @@ static void writemsg(LAMMPS *lmp, const char *msg, int abend=1) void Deprecated::command(int narg, char **arg) { - if (strcmp(input->command,"deprecated") == 0) { - writemsg(lmp,"\nCommand 'deprecated' is a dummy command\n\n",0); + if (strcmp(input->command,"DEPRECATED") == 0) { + writemsg(lmp,"\nCommand 'DEPRECATED' is a dummy command\n\n",0); - } else if (strcmp(input->command,"XXX") == 0) { - writemsg(lmp, "\nCommand 'XXX' has been removed from LAMMPS " - "after the\n## XXX 20## stable release.\n\n"); } } diff --git a/src/deprecated.h b/src/deprecated.h index 98355792456f5554539d285d587e104e49836aea..97a77591c51ecce5e461b5a71fc56c1433160cb2 100644 --- a/src/deprecated.h +++ b/src/deprecated.h @@ -13,8 +13,7 @@ #ifdef COMMAND_CLASS -CommandStyle(deprecated,Deprecated) -CommandStyle(XXX,Deprecated) +CommandStyle(DEPRECATED,Deprecated) #else diff --git a/src/fix_deprecated.cpp b/src/fix_deprecated.cpp index 666ec417340dd306363533a333672b14c483ce75..7db27152ba9fdc5cc79de59231182835679baced 100644 --- a/src/fix_deprecated.cpp +++ b/src/fix_deprecated.cpp @@ -18,35 +18,33 @@ using namespace LAMMPS_NS; +static void writemsg(LAMMPS *lmp, const char *msg, int abend=1) +{ + if (lmp->comm->me == 0) { + if (lmp->screen) fputs(msg,lmp->screen); + if (lmp->logfile) fputs(msg,lmp->logfile); + } + if (abend) + lmp->error->all(FLERR,"This fix style is no longer available"); +} + /* ---------------------------------------------------------------------- */ FixDeprecated::FixDeprecated(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { - if (strcmp(style,"deprecated") == 0) { - const char *message = "\n" - "NOTE: The fix style 'deprecated' is a dummy fix style that was added to\n" - "LAMMPS in order to print suitable error messages for deleted features.\n\n"; - - if (comm->me == 0) { - if (screen) fputs(message,screen); - if (logfile) fputs(message,logfile); - } - } - if (strncmp(style,"ave/spatial",11) == 0) { - const char *message = "\n" - "NOTE: The fix styles 'ave/spatial' and 'ave/spatial/sphere' have been replaced\n" - "by the more general fix ave/chunk and compute chunk/atom commands.\n" - "All ave/spatial and ave/spatial/sphere functionality is available in these\n" - "new commands. These ave/spatial keywords & options are part of fix ave/chunk:\n" - " Nevery, Nrepeat, Nfreq, input values, norm, ave, file, overwrite, title123\n" - "These ave/spatial keywords & options for binning are part of compute chunk/atom:\n" - " dim, origin, delta, region, bound, discard, units\n\n"; - - if (comm->me == 0) { - if (screen) fputs(message,screen); - if (logfile) fputs(message,logfile); - } + if (strcmp(style,"DEPRECATED") == 0) { + writemsg(lmp,"\nFix style 'DEPRECATED' is a dummy style\n\n",0); + + } else if (strncmp(style,"ave/spatial",11) == 0) { + writemsg(lmp,"\nFix styles 'ave/spatial' and 'ave/spatial/sphere' have " + "been replaced\nby the more general fix ave/chunk and compute " + "chunk/atom commands.\nAll ave/spatial and ave/spatial/sphere " + "functionality is available in these\nnew commands. These " + "ave/spatial keywords & options are part of fix ave/chunk:\n" + " Nevery, Nrepeat, Nfreq, input values, norm, ave, file, " + "overwrite, title123\nThese ave/spatial keywords & options for " + "binning are part of compute chunk/atom:\n dim, origin, delta," + " region, bound, discard, units\n\n"); } - error->all(FLERR,"This fix command has been removed from LAMMPS"); } diff --git a/src/fix_deprecated.h b/src/fix_deprecated.h index f4e76c47e8dd8d9e8c54fcd12e173f21b80cc8e9..a7267be04b4b8b6c4f3f1e657c28189012c18573 100644 --- a/src/fix_deprecated.h +++ b/src/fix_deprecated.h @@ -15,7 +15,7 @@ // list all deprecated and removed fix styles here -FixStyle(deprecated,FixDeprecated) +FixStyle(DEPRECATED,FixDeprecated) FixStyle(ave/spatial,FixDeprecated) FixStyle(ave/spatial/sphere,FixDeprecated) diff --git a/src/pair_deprecated.cpp b/src/pair_deprecated.cpp index 143cfd46f4b380f2aa3de25b659b27500165ee7c..20b5c9775b8c0e2146e1c93b02eacbc6d64243c2 100644 --- a/src/pair_deprecated.cpp +++ b/src/pair_deprecated.cpp @@ -31,10 +31,9 @@ static void writemsg(LAMMPS *lmp, const char *msg, int abend=1) if (lmp->logfile) fputs(msg,lmp->logfile); } if (abend) - lmp->error->all(FLERR,"This pair_style is no longer available"); + lmp->error->all(FLERR,"This pair style is no longer available"); } - /* ---------------------------------------------------------------------- */ void PairDeprecated::settings(int, char **) @@ -43,18 +42,15 @@ void PairDeprecated::settings(int, char **) // hybrid substyles are created in PairHybrid::settings(), so when this is // called, our style was just added at the end of the list of substyles + if (strncmp(my_style,"hybrid",6) == 0) { PairHybrid *hybrid = (PairHybrid *)force->pair; my_style = hybrid->keywords[hybrid->nstyles]; } - if (strcmp(my_style,"deprecated") == 0) { - writemsg(lmp,"\nPair style 'deprecated' is a dummy pair style\n\n",0); + if (strcmp(my_style,"DEPRECATED") == 0) { + writemsg(lmp,"\nPair style 'DEPRECATED' is a dummy style\n\n",0); - } else if (strcmp(my_style,"reax") == 0) { - writemsg(lmp, "\nPair style 'reax' has been removed from LAMMPS " - "after the\n## November 2018 stable release. Its " - "functionality has\nbeen superseded by pair style 'reax/c'.\n\n"); } } diff --git a/src/pair_deprecated.h b/src/pair_deprecated.h index 163b2a8f1b9224214e5986c9bb1aa98fc4b2c488..779dedee9abda5468c78d0ebbebfb4f9a727d30f 100644 --- a/src/pair_deprecated.h +++ b/src/pair_deprecated.h @@ -13,7 +13,7 @@ #ifdef PAIR_CLASS -PairStyle(deprecated,PairDeprecated) +PairStyle(DEPRECATED,PairDeprecated) #else