From b28e6503080c45a7d5480974521bca6a41005acd Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 24 Apr 2023 16:04:05 -0400 Subject: [PATCH] add deprecation warning for cuboid and sphere keywords --- doc/src/fix_dpd_source.rst | 5 +++++ src/DPD-MESO/fix_edpd_source.cpp | 7 +++++++ src/DPD-MESO/fix_tdpd_source.cpp | 7 +++++++ 3 files changed, 19 insertions(+) diff --git a/doc/src/fix_dpd_source.rst b/doc/src/fix_dpd_source.rst index 61c328eb42..ade9659d00 100644 --- a/doc/src/fix_dpd_source.rst +++ b/doc/src/fix_dpd_source.rst @@ -61,6 +61,11 @@ heat conduction with a source term (see Fig.12 in :ref:`(Li2014) `) or diffusion with a source term (see Fig.1 in :ref:`(Li2015) `), as an analog of a periodic Poiseuille flow problem. +.. deprecated:: TBD + + The *sphere* and *cuboid* keywords will be removed in a future version + of LAMMPS. The same functionality and more can be achieved with a region. + If the *sphere* keyword is used, the *cx, cy, cz, radius* values define a spherical domain to apply the source flux to. diff --git a/src/DPD-MESO/fix_edpd_source.cpp b/src/DPD-MESO/fix_edpd_source.cpp index 2e3358bf48..3df96855f0 100644 --- a/src/DPD-MESO/fix_edpd_source.cpp +++ b/src/DPD-MESO/fix_edpd_source.cpp @@ -14,6 +14,7 @@ #include "fix_edpd_source.h" #include "atom.h" +#include "comm.h" #include "domain.h" #include "error.h" #include "region.h" @@ -43,6 +44,9 @@ FixEDPDSource::FixEDPDSource(LAMMPS *lmp, int narg, char **arg) : center[2] = utils::numeric(FLERR, arg[iarg++], false, lmp); radius = utils::numeric(FLERR, arg[iarg++], false, lmp); value = utils::numeric(FLERR, arg[iarg++], false, lmp); + if (comm->me == 0) + error->warning(FLERR, "The sphere keyword is deprecated and will be removed in the future."); + } else if (strcmp(arg[iarg], "cuboid") == 0) { option = CUBOID; if (narg != 11) error->all(FLERR, "Illegal fix edpd/source command (6 args for cuboid)"); @@ -54,6 +58,9 @@ FixEDPDSource::FixEDPDSource(LAMMPS *lmp, int narg, char **arg) : dLy = utils::numeric(FLERR, arg[iarg++], false, lmp); dLz = utils::numeric(FLERR, arg[iarg++], false, lmp); value = utils::numeric(FLERR, arg[iarg++], false, lmp); + if (comm->me == 0) + error->warning(FLERR, "The cuboid keyword is deprecated and will be removed in the future."); + } else if (strcmp(arg[iarg], "region") == 0) { option = REGION; if (narg != 6) error->all(FLERR, "Illegal fix edpd/source command (2 args for region)"); diff --git a/src/DPD-MESO/fix_tdpd_source.cpp b/src/DPD-MESO/fix_tdpd_source.cpp index c5856b5b8c..d1e2b5bbd6 100644 --- a/src/DPD-MESO/fix_tdpd_source.cpp +++ b/src/DPD-MESO/fix_tdpd_source.cpp @@ -14,6 +14,7 @@ #include "fix_tdpd_source.h" #include "atom.h" +#include "comm.h" #include "domain.h" #include "error.h" #include "region.h" @@ -45,6 +46,9 @@ FixTDPDSource::FixTDPDSource(LAMMPS *lmp, int narg, char **arg) : center[2] = utils::numeric(FLERR, arg[iarg++], false, lmp); radius = utils::numeric(FLERR, arg[iarg++], false, lmp); value = utils::numeric(FLERR, arg[iarg++], false, lmp); + if (comm->me == 0) + error->warning(FLERR, "The sphere keyword is deprecated and will be removed in the future."); + } else if (strcmp(arg[iarg], "cuboid") == 0) { option = CUBOID; if (narg != 12) error->all(FLERR, "Illegal fix tdpd/source command (7 args for cuboid)"); @@ -56,6 +60,9 @@ FixTDPDSource::FixTDPDSource(LAMMPS *lmp, int narg, char **arg) : dLy = utils::numeric(FLERR, arg[iarg++], false, lmp); dLz = utils::numeric(FLERR, arg[iarg++], false, lmp); value = utils::numeric(FLERR, arg[iarg++], false, lmp); + if (comm->me == 0) + error->warning(FLERR, "The cuboid keyword is deprecated and will be removed in the future."); + } else if (strcmp(arg[iarg], "region") == 0) { option = REGION; if (narg != 7) error->all(FLERR, "Illegal fix tdpd/source command (2 args for region)");