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

@ -18,7 +18,7 @@
#include "compute_chunk_atom.h"
#include "domain.h"
#include "error.h"
#include "fix_store.h"
#include "fix_store_global.h"
#include "group.h"
#include "memory.h"
#include "modify.h"
@ -31,8 +31,8 @@ using namespace LAMMPS_NS;
/* ---------------------------------------------------------------------- */
ComputeMSDChunk::ComputeMSDChunk(LAMMPS *lmp, int narg, char **arg) :
Compute(lmp, narg, arg),
idchunk(nullptr), id_fix(nullptr), massproc(nullptr), masstotal(nullptr), com(nullptr), comall(nullptr), msd(nullptr)
Compute(lmp, narg, arg), idchunk(nullptr), id_fix(nullptr), massproc(nullptr),
masstotal(nullptr), com(nullptr), comall(nullptr), msd(nullptr)
{
if (narg != 4) error->all(FLERR,"Illegal compute msd/chunk command");
@ -57,8 +57,8 @@ ComputeMSDChunk::ComputeMSDChunk(LAMMPS *lmp, int narg, char **arg) :
// otherwise size reset and init will be done in setup()
id_fix = utils::strdup(std::string(id) + "_COMPUTE_STORE");
fix = dynamic_cast<FixStore *>( modify->add_fix(fmt::format("{} {} STORE global 1 1",
id_fix,group->names[igroup])));
fix = dynamic_cast<FixStoreGlobal *>(
modify->add_fix(fmt::format("{} {} STORE/GLOBAL 1 1", id_fix,group->names[igroup])));
}
/* ---------------------------------------------------------------------- */
@ -93,7 +93,7 @@ void ComputeMSDChunk::init()
// if firstflag, will be created in setup()
if (!firstflag) {
fix = dynamic_cast<FixStore *>( modify->get_fix_by_id(id_fix));
fix = dynamic_cast<FixStoreGlobal *>(modify->get_fix_by_id(id_fix));
if (!fix) error->all(FLERR,"Could not find compute msd/chunk fix with ID {}", id_fix);
}
}