error out in compute ave/sphere/atom and efield/wolf/atom with multi-cutoff neighborlists

This commit is contained in:
Axel Kohlmeyer
2024-03-03 12:46:20 -05:00
parent 2809428fe2
commit 372260ec77
4 changed files with 13 additions and 2 deletions

View File

@ -102,6 +102,8 @@ This compute is part of the EXTRA-COMPUTE package. It is only enabled
if LAMMPS was built with that package. See the :doc:`Build package
<Build_package>` page for more info.
This compute requires :doc:`neighbor styles 'bin' or 'nsq' <neighbor>`.
Related commands
""""""""""""""""

View File

@ -106,6 +106,8 @@ Restrictions
This compute is part of the EXTRA-COMPUTE package. It is only enabled if
LAMMPS was built with that package.
This compute requires :doc:`neighbor styles 'bin' or 'nsq' <neighbor>`.
Related commands
""""""""""""""""

View File

@ -33,7 +33,7 @@
#include <cstring>
using namespace LAMMPS_NS;
using namespace MathConst;
using MathConst::MY_PI;
/* ---------------------------------------------------------------------- */
@ -108,6 +108,9 @@ void ComputeAveSphereAtom::init()
else
volume = MY_PI * cutsq;
if ((neighbor->style == Neighbor::MULTI) || (neighbor->style == Neighbor::MULTI_OLD))
error->all(FLERR, "Compute ave/sphere/atom requires neighbor style 'bin' or 'nsq'");
// need an occasional full neighbor list
auto req = neighbor->add_request(this, NeighConst::REQ_FULL | NeighConst::REQ_OCCASIONAL);

View File

@ -92,7 +92,11 @@ void ComputeEfieldWolfAtom::init()
if (atom->mu_flag && (comm->me == 0))
error->warning(FLERR, "Compute efield/wolf/atom does not support per-atom dipoles");
// need an occasional full neighbor list
if ((neighbor->style == Neighbor::MULTI) || (neighbor->style == Neighbor::MULTI_OLD))
error->all(FLERR, "Compute efield/wolf/atom requires neighbor style 'bin' or 'nsq'");
// request an occasional full neighbor list
auto req = neighbor->add_request(this, NeighConst::REQ_FULL | NeighConst::REQ_OCCASIONAL);
if (cutoff_flag) req->set_cutoff(cutoff);