From fe9915f3072fe16f11f8e637593276325aeb573e Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 7 Apr 2025 14:37:35 -0400 Subject: [PATCH] disable support for neighbors of ghosts. see also bff980b56faf7b98b422677bbc28a79b9d7da575 --- src/ML-IAP/pair_mliap.cpp | 9 +++++++-- unittest/force-styles/test_mliappy_unified.cpp | 7 ++++++- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/ML-IAP/pair_mliap.cpp b/src/ML-IAP/pair_mliap.cpp index 5b569702d0..88d291a682 100644 --- a/src/ML-IAP/pair_mliap.cpp +++ b/src/ML-IAP/pair_mliap.cpp @@ -336,12 +336,17 @@ void PairMLIAP::v_tally(int i, int j, double *fij, double *rij) void PairMLIAP::init_style() { if (force->newton_pair == 0) - error->all(FLERR,"Pair style MLIAP requires newton pair on"); + error->all(FLERR, Error::NOLASTLINE, "Pair style mliap requires newton pair on"); // need a full neighbor list if (ghostneigh == 1) { - neighbor->add_request(this, NeighConst::REQ_FULL | NeighConst::REQ_GHOST); + // AK: 2025-04-07 nothing seems to be using this feature and it was leaking memory, too. + error->all(FLERR, Error::NOLASTLINE, + "Pair_style mliap does not support requesting neighbors of ghost atoms anymore.\n" + "If you have a model requiring this setting, please contact the LAMMPS developers" + + utils::errorurl(35)); + // neighbor->add_request(this, NeighConst::REQ_FULL | NeighConst::REQ_GHOST); } else { neighbor->add_request(this, NeighConst::REQ_FULL); } diff --git a/unittest/force-styles/test_mliappy_unified.cpp b/unittest/force-styles/test_mliappy_unified.cpp index a8309feb21..996d4d82d5 100644 --- a/unittest/force-styles/test_mliappy_unified.cpp +++ b/unittest/force-styles/test_mliappy_unified.cpp @@ -77,6 +77,11 @@ TEST(MliapUnified, VersusLJMelt) lammps_close(mliap); } +#if 0 + +// This setting was producing wrong results and leaking memory. +// Thus support for it was removed from LAMMPS. + TEST(MliapUnified, VersusLJMeltGhost) { const char *lmpargv[] = {"melt", "-log", "none", "-nocite"}; @@ -112,5 +117,5 @@ TEST(MliapUnified, VersusLJMeltGhost) lammps_close(ljmelt); lammps_close(mliap); } - +#endif } // namespace LAMMPS_NS