move diamflag from fix adapt and adapt/fep to base class for cleaner code

This commit is contained in:
Axel Kohlmeyer
2023-07-17 22:17:05 -04:00
parent dba4d9ebbc
commit 1057fa9b00
8 changed files with 17 additions and 34 deletions

View File

@ -16,8 +16,6 @@
#include "atom.h"
#include "error.h"
#include "fix.h"
#include "fix_adapt.h"
#include "fix_adapt_fep.h"
#include "math_const.h"
#include "modify.h"
@ -90,16 +88,9 @@ void AtomVecSphere::init()
// check if optional radvary setting should have been set to 1
for (auto &ifix : modify->get_fix_by_style("^adapt")) {
if (utils::strmatch(ifix->style, "^adapt$")) {
auto fix = dynamic_cast<FixAdapt *>(ifix);
if (fix && fix->diamflag && radvary == 0)
error->all(FLERR, "Fix adapt changes particle radii but atom_style sphere is not dynamic");
}
if (utils::strmatch(ifix->style, "^adapt/fep$")) {
auto fix = dynamic_cast<FixAdaptFEP *>(ifix);
if (fix && fix->diamflag && radvary == 0)
error->all(FLERR, "Fix adapt/fep changes particle radii but atom_style sphere is not dynamic");
}
if (ifix->diam_flag && (radvary == 0))
error->all(FLERR, "Fix {} changes atom radii but atom_style sphere is not dynamic",
ifix->style);
}
}