From 499192a1b2eba5c0aa6cdb6c1bb79faaa92a29db Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Mon, 7 Apr 2025 16:27:16 -0400 Subject: [PATCH] restore option to request neighbor lists with neighbors of ghosts --- src/ML-IAP/pair_mliap.cpp | 9 +++------ unittest/force-styles/test_mliappy_unified.cpp | 6 ------ 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/ML-IAP/pair_mliap.cpp b/src/ML-IAP/pair_mliap.cpp index 88d291a682..4858c7e0ea 100644 --- a/src/ML-IAP/pair_mliap.cpp +++ b/src/ML-IAP/pair_mliap.cpp @@ -73,6 +73,7 @@ PairMLIAP::~PairMLIAP() memory->destroy(setflag); memory->destroy(cutsq); memory->destroy(map); + memory->destroy(cutghost); } } @@ -125,6 +126,7 @@ void PairMLIAP::allocate() memory->create(setflag,n+1,n+1,"pair:setflag"); memory->create(cutsq,n+1,n+1,"pair:cutsq"); memory->create(map,n+1,"pair:map"); + if (ghostneigh) memory->create(cutghost, n+1, n+1, "pair:cutghost"); } /* ---------------------------------------------------------------------- @@ -341,12 +343,7 @@ void PairMLIAP::init_style() // need a full neighbor list if (ghostneigh == 1) { - // 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); + 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 996d4d82d5..53cb07cb0f 100644 --- a/unittest/force-styles/test_mliappy_unified.cpp +++ b/unittest/force-styles/test_mliappy_unified.cpp @@ -77,11 +77,6 @@ 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"}; @@ -117,5 +112,4 @@ TEST(MliapUnified, VersusLJMeltGhost) lammps_close(ljmelt); lammps_close(mliap); } -#endif } // namespace LAMMPS_NS