refactor/simplify code due to changes in Modify

This commit is contained in:
Axel Kohlmeyer
2021-08-06 21:30:32 -04:00
parent f23b04f9b6
commit 68c15ebf04
11 changed files with 43 additions and 79 deletions

View File

@ -252,12 +252,9 @@ void FixAdapt::post_constructor()
id_fix_chg = nullptr;
if (diamflag && atom->radius_flag) {
std::string fixcmd = id + std::string("_FIX_STORE_DIAM");
id_fix_diam = utils::strdup(fixcmd);
fixcmd += fmt::format(" {} STORE peratom 1 1",group->names[igroup]);
modify->add_fix(fixcmd);
fix_diam = (FixStore *) modify->fix[modify->nfix-1];
id_fix_diam = utils::strdup(id + std::string("_FIX_STORE_DIAM"));
fix_diam = (FixStore *) modify->add_fix(fmt::format("{} {} STORE peratom 1 1",
id_fix_diam,group->names[igroup]));
if (fix_diam->restart_reset) fix_diam->restart_reset = 0;
else {
double *vec = fix_diam->vstore;
@ -273,12 +270,9 @@ void FixAdapt::post_constructor()
}
if (chgflag && atom->q_flag) {
std::string fixcmd = id + std::string("_FIX_STORE_CHG");
id_fix_chg = utils::strdup(fixcmd);
fixcmd += fmt::format(" {} STORE peratom 1 1",group->names[igroup]);
modify->add_fix(fixcmd);
fix_chg = (FixStore *) modify->fix[modify->nfix-1];
id_fix_chg = utils::strdup(id + std::string("_FIX_STORE_CHG"));
fix_chg = (FixStore *) modify->add_fix(fmt::format("{} {} STORE peratom 1 1",
id_fix_chg,group->names[igroup]));
if (fix_chg->restart_reset) fix_chg->restart_reset = 0;
else {
double *vec = fix_chg->vstore;