must not forget to generate compute ids and store them.

This commit is contained in:
Axel Kohlmeyer
2020-06-26 15:42:37 -04:00
parent 1ea0eca2a5
commit a5651acb49
8 changed files with 52 additions and 75 deletions

View File

@ -13,6 +13,7 @@
#include "fix_temp_berendsen.h"
#include <cstring>
#include <string>
#include <cmath>
#include "atom.h"
#include "force.h"
@ -70,17 +71,12 @@ FixTempBerendsen::FixTempBerendsen(LAMMPS *lmp, int narg, char **arg) :
// create a new compute temp style
// id = fix-ID + temp, compute group = fix group
int n = strlen(id) + 6;
id_temp = new char[n];
strcpy(id_temp,id);
strcat(id_temp,"_temp");
std::string cmd = id + std::string("_temp");
id_temp = new char[cmd.size()+1];
strcpy(id_temp,cmd.c_str());
char **newarg = new char*[3];
newarg[0] = id_temp;
newarg[1] = group->names[igroup];
newarg[2] = (char *) "temp";
modify->add_compute(3,newarg);
delete [] newarg;
cmd += group->names[igroup] + std::string(" temp");
modify->add_compute(cmd);
tflag = 1;
energy = 0;