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

@ -14,18 +14,17 @@
#include "compute_msd_chunk.h"
#include <cstring>
#include "atom.h"
#include "group.h"
#include "update.h"
#include "modify.h"
#include "compute_chunk_atom.h"
#include "domain.h"
#include "fix_store.h"
#include "memory.h"
#include "error.h"
#include "fix_store.h"
#include "group.h"
#include "memory.h"
#include "modify.h"
#include "update.h"
#include <cstring>
using namespace LAMMPS_NS;
@ -52,16 +51,14 @@ ComputeMSDChunk::ComputeMSDChunk(LAMMPS *lmp, int narg, char **arg) :
// create a new fix STORE style for reference positions
// id = compute-ID + COMPUTE_STORE, fix group = compute group
// do not know size of array at this point, just allocate 1x3 array
// do not know size of array at this point, just allocate 1x1 array
// fix creation must be done now so that a restart run can
// potentially re-populate the fix array (and change it to correct size)
// otherwise size reset and init will be done in setup()
id_fix = utils::strdup(std::string(id) + "_COMPUTE_STORE");
std::string fixcmd = id_fix
+ fmt::format(" {} STORE global 1 1",group->names[igroup]);
modify->add_fix(fixcmd);
fix = (FixStore *) modify->fix[modify->nfix-1];
fix = (FixStore *) modify->add_fix(fmt::format("{} {} STORE global 1 1",
id_fix,group->names[igroup]));
}
/* ---------------------------------------------------------------------- */