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:
@ -306,6 +306,16 @@ void AngleHybrid::coeff(int narg, char **arg)
|
||||
|
||||
void AngleHybrid::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->nangletypes; ++itype)
|
||||
if (map[itype] == istyle) used = 1;
|
||||
if (used == 0) error->all(FLERR, "Angle hybrid sub-style {} is not used", keywords[istyle]);
|
||||
}
|
||||
|
||||
for (int m = 0; m < nstyles; m++)
|
||||
if (styles[m]) styles[m]->init_style();
|
||||
}
|
||||
|
||||
@ -334,6 +334,16 @@ void BondHybrid::coeff(int narg, char **arg)
|
||||
|
||||
void BondHybrid::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->nbondtypes; ++itype)
|
||||
if (map[itype] == istyle) used = 1;
|
||||
if (used == 0) error->all(FLERR, "Bond hybrid sub-style {} is not used", keywords[istyle]);
|
||||
}
|
||||
|
||||
for (int m = 0; m < nstyles; m++)
|
||||
if (styles[m]) styles[m]->init_style();
|
||||
|
||||
|
||||
@ -313,6 +313,16 @@ void DihedralHybrid::coeff(int narg, char **arg)
|
||||
|
||||
void DihedralHybrid::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->ndihedraltypes; ++itype)
|
||||
if (map[itype] == istyle) used = 1;
|
||||
if (used == 0) error->all(FLERR, "Dihedral hybrid sub-style {} is not used", keywords[istyle]);
|
||||
}
|
||||
|
||||
for (int m = 0; m < nstyles; m++)
|
||||
if (styles[m]) styles[m]->init_style();
|
||||
}
|
||||
|
||||
@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user