only compute special neighbors of a template if it has bonds

This commit is contained in:
Axel Kohlmeyer
2025-04-09 16:12:47 -04:00
parent f16f65c8dc
commit 8fd1bf23c9
17 changed files with 49 additions and 51 deletions

View File

@ -173,7 +173,7 @@ void NPairNsq<HALF, NEWTON, TRI, SIZE>::build(NeighList *list)
if (molecular != Atom::ATOMIC) {
if (!moltemplate)
which = find_special(special[i], nspecial[i], tag[j]);
else if (imol >= 0)
else if ((imol >= 0) && onemols[imol]->special)
which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom],
tag[j] - tagprev);
else
@ -192,7 +192,7 @@ void NPairNsq<HALF, NEWTON, TRI, SIZE>::build(NeighList *list)
if (molecular != Atom::ATOMIC) {
if (!moltemplate)
which = find_special(special[i], nspecial[i], tag[j]);
else if (imol >= 0)
else if ((imol >= 0) && onemols[imol]->special)
which = find_special(onemols[imol]->special[iatom], onemols[imol]->nspecial[iatom],
tag[j] - tagprev);
else