print warning when using fix efield with a TIP4P pair style

This commit is contained in:
Axel Kohlmeyer
2023-03-16 18:33:23 -04:00
parent bf94448843
commit ea20c934ea

View File

@ -26,6 +26,7 @@
#include "input.h" #include "input.h"
#include "memory.h" #include "memory.h"
#include "modify.h" #include "modify.h"
#include "pair.h"
#include "region.h" #include "region.h"
#include "respa.h" #include "respa.h"
#include "update.h" #include "update.h"
@ -145,6 +146,13 @@ void FixEfield::init()
if (atom->mu_flag && atom->torque_flag) muflag = 1; if (atom->mu_flag && atom->torque_flag) muflag = 1;
if (!qflag && !muflag) error->all(FLERR, "Fix {} requires atom attribute q or mu", style); if (!qflag && !muflag) error->all(FLERR, "Fix {} requires atom attribute q or mu", style);
// warn if TIP4P pair style is used with plain fix efield
if ((strcmp(style, "efield") == 0) && (comm->me == 0)) {
int itmp;
if (force->pair && force->pair->extract("qdist", itmp))
error->warning(FLERR, "Fix efield produces incorrect forces when applied to TIP4P atoms");
}
// check variables // check variables
if (xstr) { if (xstr) {