add deprecation warning to fix langevin and document it

This commit is contained in:
Axel Kohlmeyer
2025-04-29 17:20:04 -04:00
parent 332006923d
commit 1062a8fb3a
3 changed files with 21 additions and 0 deletions

View File

@ -12,6 +12,17 @@ stop LAMMPS and print a suitable error message in most cases, when a
style/command is used that has been removed or will replace the command
with the direct alternative (if available) and print a warning.
GJF formulation in fix langevin
-------------------------------
.. deprecated:: TBD
The *gjf* keyword in fix langevin is deprecated and will be removed
soon. The GJF functionality has been moved to its own fix style
:doc:`fix gjf <fix_gjf>` and it is strongly recommended to use that
fix instead.
LAMMPS shell
------------

View File

@ -241,6 +241,13 @@ to zero by subtracting off an equal part of it from each atom in the
group. As a result, the center-of-mass of a system with zero initial
momentum will not drift over time.
.. deprecated:: TDB
The *gjf* keyword in fix langevin is deprecated and will be removed
soon. The GJF functionality has been moved to its own fix style
:doc:`fix gjf <fix_gjf>` and it is strongly recommended to use that
fix instead.
The keyword *gjf* can be used to run the :ref:`Gronbech-Jensen/Farago
<Gronbech-Jensen>` time-discretization of the Langevin model. As
described in the papers cited below, the purpose of this method is to

View File

@ -170,6 +170,9 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) :
// no need to set peratom_flag, b/c data is for internal use only
if (gjfflag) {
if (comm->me == 0)
error->warning(FLERR, "The GJF formulation in fix {} is deprecated and will be removed soon. "
"\nPlease use fix gjf instead: https://docs.lammps.org/fix_gjf.html", style);
FixLangevin::grow_arrays(atom->nmax);
atom->add_callback(Atom::GROW);