restore option to request neighbor lists with neighbors of ghosts

This commit is contained in:
Axel Kohlmeyer
2025-04-07 16:27:16 -04:00
parent fe9915f307
commit 499192a1b2
2 changed files with 3 additions and 12 deletions

View File

@ -73,6 +73,7 @@ PairMLIAP::~PairMLIAP()
memory->destroy(setflag); memory->destroy(setflag);
memory->destroy(cutsq); memory->destroy(cutsq);
memory->destroy(map); memory->destroy(map);
memory->destroy(cutghost);
} }
} }
@ -125,6 +126,7 @@ void PairMLIAP::allocate()
memory->create(setflag,n+1,n+1,"pair:setflag"); memory->create(setflag,n+1,n+1,"pair:setflag");
memory->create(cutsq,n+1,n+1,"pair:cutsq"); memory->create(cutsq,n+1,n+1,"pair:cutsq");
memory->create(map,n+1,"pair:map"); 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 // need a full neighbor list
if (ghostneigh == 1) { if (ghostneigh == 1) {
// AK: 2025-04-07 nothing seems to be using this feature and it was leaking memory, too. neighbor->add_request(this, NeighConst::REQ_FULL | NeighConst::REQ_GHOST);
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 { } else {
neighbor->add_request(this, NeighConst::REQ_FULL); neighbor->add_request(this, NeighConst::REQ_FULL);
} }

View File

@ -77,11 +77,6 @@ TEST(MliapUnified, VersusLJMelt)
lammps_close(mliap); 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) TEST(MliapUnified, VersusLJMeltGhost)
{ {
const char *lmpargv[] = {"melt", "-log", "none", "-nocite"}; const char *lmpargv[] = {"melt", "-log", "none", "-nocite"};
@ -117,5 +112,4 @@ TEST(MliapUnified, VersusLJMeltGhost)
lammps_close(ljmelt); lammps_close(ljmelt);
lammps_close(mliap); lammps_close(mliap);
} }
#endif
} // namespace LAMMPS_NS } // namespace LAMMPS_NS