From 3cae295f5bf3728973b3d073cbbccab76d0bfb76 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 11 Aug 2020 15:04:03 -0400 Subject: [PATCH] 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. --- doc/src/bond_special.rst | 7 +++++-- src/USER-MISC/bond_special.cpp | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/doc/src/bond_special.rst b/doc/src/bond_special.rst index 8c90179e96..f7dc43a1b2 100644 --- a/doc/src/bond_special.rst +++ b/doc/src/bond_special.rst @@ -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 ` doc page for more info. -This bond style requires use of a :doc:`pair_style ` which -computes a pairwise interaction. Many-body potentials do not. +This bond style requires the use of a :doc:`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 ` is declared, an error will be issued. diff --git a/src/USER-MISC/bond_special.cpp b/src/USER-MISC/bond_special.cpp index 30630147ce..6c734d482e 100644 --- a/src/USER-MISC/bond_special.cpp +++ b/src/USER-MISC/bond_special.cpp @@ -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)