must not forget to generate compute ids and store them.
This commit is contained in:
@ -13,6 +13,7 @@
|
||||
|
||||
#include "fix_temp_rescale.h"
|
||||
#include <cstring>
|
||||
#include <string>
|
||||
#include <cmath>
|
||||
#include "atom.h"
|
||||
#include "force.h"
|
||||
@ -66,17 +67,12 @@ FixTempRescale::FixTempRescale(LAMMPS *lmp, int narg, char **arg) :
|
||||
// create a new compute temp
|
||||
// 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*[6];
|
||||
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.0;
|
||||
|
||||
Reference in New Issue
Block a user