diff --git a/src/compute_group_group.cpp b/src/compute_group_group.cpp index ea1fa0cebf82824d344e2ffc4b1d5b93dd54f12b..bf1cb8184639ceaa6e5ba2055db313c5a3b459e8 100644 --- a/src/compute_group_group.cpp +++ b/src/compute_group_group.cpp @@ -66,8 +66,12 @@ ComputeGroupGroup::~ComputeGroupGroup() void ComputeGroupGroup::init() { if (force->pair == NULL) - error->all("Pair style does not support compute group/group"); - if (force->pair->single_enable == 0) + error->all("No pair style defined for compute group/group"); + + // if non-hybrid, then error if single_enable = 0 + // if hybrid, let hybrid determine if sub-style sets single_enable = 0 + + if (force->pair_match("hybrid",0) == NULL && force->pair->single_enable == 0) error->all("Pair style does not support compute group/group"); pair = force->pair; diff --git a/src/pair_hybrid.cpp b/src/pair_hybrid.cpp index b71af67dad1fbeb5eb228d03e51784c1c5b22648..5d1e644c91ca57e15e8df72112a58e59c504d519 100644 --- a/src/pair_hybrid.cpp +++ b/src/pair_hybrid.cpp @@ -576,6 +576,7 @@ void PairHybrid::read_restart(FILE *fp) /* ---------------------------------------------------------------------- call sub-style to compute single interaction + error if sub-style does not support single() call since overlay could have multiple sub-styles, sum results explicitly ------------------------------------------------------------------------- */ @@ -592,6 +593,8 @@ double PairHybrid::single(int i, int j, int itype, int jtype, for (int m = 0; m < nmap[itype][jtype]; m++) { if (rsq < styles[map[itype][jtype][m]]->cutsq[itype][jtype]) { + if (styles[map[itype][jtype][m]]->single_enable == 0) + error->all("Pair hybrid sub-style does not support single call"); esum += styles[map[itype][jtype][m]]-> single(i,j,itype,jtype,rsq,factor_coul,factor_lj,fone); fforce += fone;