adapt all users of FixStore to use FixStoreGlobal or FixStorePeratom

This commit is contained in:
Axel Kohlmeyer
2022-08-04 11:33:14 -04:00
parent 63fc9fcc62
commit 6c32058728
35 changed files with 203 additions and 214 deletions

View File

@ -19,7 +19,7 @@
#include "bond.h"
#include "domain.h"
#include "error.h"
#include "fix_store.h"
#include "fix_store_peratom.h"
#include "force.h"
#include "group.h"
#include "input.h"
@ -278,8 +278,8 @@ void FixAdapt::post_constructor()
if (diamflag && atom->radius_flag) {
id_fix_diam = utils::strdup(id + std::string("_FIX_STORE_DIAM"));
fix_diam = dynamic_cast<FixStore *>( modify->add_fix(fmt::format("{} {} STORE peratom 1 1",
id_fix_diam,group->names[igroup])));
fix_diam = dynamic_cast<FixStorePeratom *>(
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;
@ -296,8 +296,8 @@ void FixAdapt::post_constructor()
if (chgflag && atom->q_flag) {
id_fix_chg = utils::strdup(id + std::string("_FIX_STORE_CHG"));
fix_chg = dynamic_cast<FixStore *>( modify->add_fix(fmt::format("{} {} STORE peratom 1 1",
id_fix_chg,group->names[igroup])));
fix_chg = dynamic_cast<FixStorePeratom *>(
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;
@ -492,18 +492,16 @@ void FixAdapt::init()
// fixes that store initial per-atom values
if (id_fix_diam) {
int ifix = modify->find_fix(id_fix_diam);
if (ifix < 0) error->all(FLERR,"Could not find fix adapt storage fix ID");
fix_diam = dynamic_cast<FixStore *>( modify->fix[ifix]);
fix_diam = dynamic_cast<FixStorePeratom *>(modify->get_fix_by_id(id_fix_diam));
if (!fix_diam) error->all(FLERR,"Could not find fix adapt storage fix ID {}", id_fix_diam);
}
if (id_fix_chg) {
int ifix = modify->find_fix(id_fix_chg);
if (ifix < 0) error->all(FLERR,"Could not find fix adapt storage fix ID");
fix_chg = dynamic_cast<FixStore *>( modify->fix[ifix]);
fix_chg = dynamic_cast<FixStorePeratom *>(modify->get_fix_by_id(id_fix_chg));
if (!fix_chg) error->all(FLERR,"Could not find fix adapt storage fix ID {}", id_fix_chg);
}
if (utils::strmatch(update->integrate_style,"^respa"))
nlevels_respa = (dynamic_cast<Respa *>( update->integrate))->nlevels;
nlevels_respa = (dynamic_cast<Respa *>(update->integrate))->nlevels;
}
/* ---------------------------------------------------------------------- */