simplify fix instance creation

This commit is contained in:
Axel Kohlmeyer
2021-07-29 15:18:58 -04:00
parent 520109bda0
commit dcff3d70e0
3 changed files with 8189 additions and 9 deletions

View File

@ -283,15 +283,8 @@ void PairTracker::init_style()
// this is so its order in the fix list is preserved
if (fix_history == nullptr) {
char dnumstr[16];
sprintf(dnumstr, "%d", size_history);
char **fixarg = new char *[4];
fixarg[0] = (char *) "NEIGH_HISTORY_TRACK";
fixarg[1] = (char *) "all";
fixarg[2] = (char *) "NEIGH_HISTORY";
fixarg[3] = dnumstr;
modify->replace_fix("NEIGH_HISTORY_TRACK_DUMMY", 4, fixarg, 1);
delete[] fixarg;
modify->replace_fix("NEIGH_HISTORY_TRACK_DUMMY",
fmt::format("NEIGH_HISTORY_TRACK all NEIGH_HISTORY {}", size_history), 1);
int ifix = modify->find_fix("NEIGH_HISTORY_TRACK");
fix_history = (FixNeighHistory *) modify->fix[ifix];
fix_history->pair = this;