update morse coeff method, fix bug in flag

This commit is contained in:
megmcca
2025-01-17 15:59:28 -07:00
parent 7fa1bf39f3
commit fecf1c2f69
3 changed files with 4 additions and 3 deletions

View File

@ -44,7 +44,6 @@ PairHbondDreidingMorseAngleoffset::PairHbondDreidingMorseAngleoffset(LAMMPS *lmp
PairHbondDreidingMorse(lmp) {
angle_offset_flag = 1;
angle_offset_global = 0.0;
}
// /* ----------------------------------------------------------------------

View File

@ -311,7 +311,7 @@ void PairHbondDreidingLJ::allocate()
void PairHbondDreidingLJ::settings(int narg, char **arg)
{
// narg = 4 for standard form and narg = 5 if angleoffset variant (from EXTRA-MOLECULE)
// narg = 4 for standard form, narg = 5 or 6 if angleoffset LJ or Morse variants respectively (from EXTRA-MOLECULE)
if (narg != 4 && narg != 5) error->all(FLERR,"Illegal pair_style command");
ap_global = utils::inumeric(FLERR,arg[0],false,lmp);

View File

@ -246,7 +246,9 @@ void PairHbondDreidingMorse::compute(int eflag, int vflag)
void PairHbondDreidingMorse::coeff(int narg, char **arg)
{
if (narg < 7 || narg > 11)
int maxarg = 12;
if (angle_offset_flag == 1) maxarg = 12;
if (narg < 7 || narg > maxarg)
error->all(FLERR,"Incorrect args for pair coefficients");
if (!allocated) allocate();