make default settings() functions for bonded interactions error out with arguments

This commit is contained in:
Axel Kohlmeyer
2022-05-14 17:55:56 -04:00
parent 42a4fba390
commit 1b552de1cd
8 changed files with 44 additions and 4 deletions

View File

@ -75,6 +75,16 @@ void Angle::init()
init_style();
}
/* ----------------------------------------------------------------------
check that there are no arguments
------------------------------------------------------------------------- */
void Angle::settings(int narg, char **args)
{
if (narg > 0)
error->all(FLERR, "Illegal angle_style {} argument: {}", force->angle_style, args[0]);
}
/* ----------------------------------------------------------------------
setup for energy, virial computation
see integrate::ev_set() for bitwise settings of eflag/vflag

View File

@ -50,7 +50,7 @@ class Angle : protected Pointers {
~Angle() override;
virtual void init();
virtual void compute(int, int) = 0;
virtual void settings(int, char **) {}
virtual void settings(int, char **);
virtual void coeff(int, char **) = 0;
virtual void init_style(){};
virtual double equilibrium_angle(int) = 0;

View File

@ -86,6 +86,16 @@ void Bond::init()
init_style();
}
/* ----------------------------------------------------------------------
check that there are no arguments
------------------------------------------------------------------------- */
void Bond::settings(int narg, char **args)
{
if (narg > 0)
error->all(FLERR, "Illegal bond_style {} argument: {}", force->bond_style, args[0]);
}
/* ----------------------------------------------------------------------
setup for energy, virial computation
see integrate::ev_set() for bitwise settings of eflag/vflag

View File

@ -53,7 +53,7 @@ class Bond : protected Pointers {
virtual void init();
virtual void init_style() {}
virtual void compute(int, int) = 0;
virtual void settings(int, char **) {}
virtual void settings(int, char **);
virtual void coeff(int, char **) = 0;
virtual double equilibrium_distance(int) = 0;
virtual void write_restart(FILE *) = 0;

View File

@ -74,6 +74,16 @@ void Dihedral::init()
init_style();
}
/* ----------------------------------------------------------------------
check that there are no arguments
------------------------------------------------------------------------- */
void Dihedral::settings(int narg, char **args)
{
if (narg > 0)
error->all(FLERR, "Illegal dihedral_style {} argument: {}", force->dihedral_style, args[0]);
}
/* ----------------------------------------------------------------------
setup for energy, virial computation
see integrate::ev_set() for bitwise settings of eflag/vflag

View File

@ -48,7 +48,7 @@ class Dihedral : protected Pointers {
virtual void init();
virtual void init_style() {}
virtual void compute(int, int) = 0;
virtual void settings(int, char **) {}
virtual void settings(int, char **);
virtual void coeff(int, char **) = 0;
virtual void write_restart(FILE *) = 0;
virtual void read_restart(FILE *) = 0;

View File

@ -73,6 +73,16 @@ void Improper::init()
init_style();
}
/* ----------------------------------------------------------------------
check that there are no arguments
------------------------------------------------------------------------- */
void Improper::settings(int narg, char **args)
{
if (narg > 0)
error->all(FLERR, "Illegal improper_style {} argument: {}", force->improper_style, args[0]);
}
/* ----------------------------------------------------------------------
setup for energy, virial computation
see integrate::ev_set() for bitwise settings of eflag/vflag

View File

@ -48,7 +48,7 @@ class Improper : protected Pointers {
virtual void init();
virtual void init_style() {}
virtual void compute(int, int) = 0;
virtual void settings(int, char **) {}
virtual void settings(int, char **);
virtual void coeff(int, char **) = 0;
virtual void write_restart(FILE *) = 0;
virtual void read_restart(FILE *) = 0;