make test for unsupported pair styles more restrictive and improve docs about that

EAM styles have a single function but are not compatible, so we test for
single_enable == 0 and manybody_flag != 0.
Improve explanation in the documentation about which pair styles are not supported.
This commit is contained in:
Axel Kohlmeyer
2020-08-11 15:04:03 -04:00
parent 03ca86ee84
commit 3cae295f5b
2 changed files with 7 additions and 3 deletions

View File

@ -89,8 +89,11 @@ This bond style can only be used if LAMMPS was built with the
USER-MISC package. See the :doc:`Build package <Build_package>` doc
page for more info.
This bond style requires use of a :doc:`pair_style <pair_style>` which
computes a pairwise interaction. Many-body potentials do not.
This bond style requires the use of a :doc:`pair_style <pair_style>` which
computes a pairwise additive interaction and provides the ability to
compute interactions for individual pairs of atoms. Manybody potentials
are not compatible in general, but also some other pair styles are missing
the required functionality and thus will cause an error.
This command is not compatible with long-range Coulombic interactions. If a
`kspace_style <kspace_style>` is declared, an error will be issued.

View File

@ -47,7 +47,8 @@ BondSpecial::~BondSpecial()
void BondSpecial::init_style()
{
if (force->pair == NULL || force->pair->single_enable == 0)
if (force->pair == NULL) error->all(FLERR,"No pair style defined");
else if ((force->pair->single_enable == 0) || force->pair->manybody_flag)
error->all(FLERR,"Pair style does not support bond style special");
if (force->special_lj[1] != 0.0 || force->special_coul[1] != 0)