error out when a bond/angle/dihedral/improper substyle is not used

this implements the same behavior as for pair style hybrid
This commit is contained in:
Axel Kohlmeyer
2022-11-30 08:09:51 -05:00
parent 5f3b719a7d
commit c11eabddc0
4 changed files with 40 additions and 0 deletions

View File

@ -305,6 +305,16 @@ void ImproperHybrid::coeff(int narg, char **arg)
void ImproperHybrid::init_style()
{
// error if sub-style is not used
int used;
for (int istyle = 0; istyle < nstyles; ++istyle) {
used = 0;
for (int itype = 1; itype <= atom->nimpropertypes; ++itype)
if (map[itype] == istyle) used = 1;
if (used == 0) error->all(FLERR, "Improper hybrid sub-style {} is not used", keywords[istyle]);
}
for (int m = 0; m < nstyles; m++)
if (styles[m]) styles[m]->init_style();
}