diff --git a/src/fix_deprecated.cpp b/src/fix_deprecated.cpp index d0a63b00964471cd76666ae655f6e7205b0a7b8b..666ec417340dd306363533a333672b14c483ce75 100644 --- a/src/fix_deprecated.cpp +++ b/src/fix_deprecated.cpp @@ -23,6 +23,16 @@ using namespace LAMMPS_NS; 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" diff --git a/src/fix_deprecated.h b/src/fix_deprecated.h index e11e283f37fdd241b84b4e178ce57f24eebc5380..f4e76c47e8dd8d9e8c54fcd12e173f21b80cc8e9 100644 --- a/src/fix_deprecated.h +++ b/src/fix_deprecated.h @@ -15,6 +15,7 @@ // list all deprecated and removed fix styles here +FixStyle(deprecated,FixDeprecated) FixStyle(ave/spatial,FixDeprecated) FixStyle(ave/spatial/sphere,FixDeprecated) diff --git a/src/modify.cpp b/src/modify.cpp index 8a0d1afa2c8db7a7194079b88903520b5b52bf96..547fc4a251d2d118755704a31055bcf08cc05729 100644 --- a/src/modify.cpp +++ b/src/modify.cpp @@ -785,16 +785,17 @@ void Modify::add_fix(int narg, char **arg, int trysuffix) // but can't think of better way // too late if instantiate fix, then check flag set in fix constructor, // since some fixes access domain settings in their constructor - // MUST change NEXCEPT above when add new fix to this list + // NULL must be last entry in this list - const char *exceptions[NEXCEPT] = - {"GPU","OMP","INTEL","property/atom","cmap","cmap3","rx"}; + const char *exceptions[] = + {"GPU", "OMP", "INTEL", "property/atom", "cmap", "cmap3", "rx", + "deprecated", NULL}; if (domain->box_exist == 0) { int m; - for (m = 0; m < NEXCEPT; m++) + for (m = 0; exceptions[m] != NULL; m++) if (strcmp(arg[2],exceptions[m]) == 0) break; - if (m == NEXCEPT) + if (exceptions[m] == NULL) error->all(FLERR,"Fix command before simulation box is defined"); } diff --git a/src/pair_deprecated.cpp b/src/pair_deprecated.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a383f390cfc715a564fc35ce59ec4fbe6873169e --- /dev/null +++ b/src/pair_deprecated.cpp @@ -0,0 +1,53 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing author: Axel Kohlmeyer (Temple U) +------------------------------------------------------------------------- */ + +#include "pair_deprecated.h" +#include "pair_hybrid.h" +#include "comm.h" +#include "force.h" +#include "error.h" + +using namespace LAMMPS_NS; + +/* ---------------------------------------------------------------------- */ + +PairDeprecated::PairDeprecated(LAMMPS *lmp) : Pair(lmp) +{ + if (strcmp(force->pair_style,"deprecated") == 0) { + const char *message = "\n" + "NOTE: The pair 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(force->pair_style,"reax",11) == 0) { + const char *message = "\n" + "NOTE: The pair style 'reax' has been removed from LAMMPS after the\n" + "## November 2018 stable release. Its functionality has long before\n" + "been superseded by pair styles 'reax/c' and 'reax/c/kk'\n\n"; + + if (comm->me == 0) { + if (screen) fputs(message,screen); + if (logfile) fputs(message,logfile); + } + } + error->all(FLERR,"This pair_style command has been removed from LAMMPS"); +} + diff --git a/src/pair_deprecated.h b/src/pair_deprecated.h new file mode 100644 index 0000000000000000000000000000000000000000..4201b3453d88d0c554e8fb28b45de5b5cdb8aa19 --- /dev/null +++ b/src/pair_deprecated.h @@ -0,0 +1,84 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef PAIR_CLASS + +PairStyle(deprecated,PairDeprecated) + +#else + +#ifndef LMP_PAIR_DEPRECATED_H +#define LMP_PAIR_DEPRECATED_H + +#include "pair.h" + +namespace LAMMPS_NS { + +class PairDeprecated : public Pair { + public: + PairDeprecated(class LAMMPS *); + virtual ~PairDeprecated() {}; + + virtual void compute(int, int) {}; + virtual void settings(int, char **) {}; + virtual void coeff(int, char **) {}; + +}; + +} + +#endif +#endif + +/* ERROR/WARNING messages: + +E: Not all pairs processed in pair_style list + +Not all interacting pairs for which coefficients were found. This can be intentional +and then you need to set the 'nocheck' option. If not, it usually means that the +communication cutoff is too small. This can be ameliorated by either increasing +the cutoff in the pair_style command or the communication cutoff. + +E: Illegal ... command + +Self-explanatory. Check the input script syntax and compare to the +documentation for the command. You can use -echo screen as a +command-line option when running LAMMPS to see the offending line. + +E: Cannot open pair list file + +Self-explanatory. The file with the list of pairs cannot be open for reading. +Check the path and permissions. + +E: Incorrectly formatted ... + +Self-explanatory. The content of the pair list file does not match the documented +format. Please re-read the documentation and carefully compare it to your file. + +E: Unknown pair list potential style + +Self-explanatory. You requested a potential type that is not yet implemented or have a typo. + +E: Incorrect args for pair coefficients + +Self-explanatory. Check the input script or data file. + +E: Pair style list requires atom IDs + +Self-explanatory. The pairs in the list are identified via atom IDs, so they need to be present. + +E: Pair style list requires an atom map + +Self-explanatory. Atoms are looked up via an atom map. Create one using the atom_style map command. + +*/