update temp and press compute creation in temperature and similar fixes

This commit is contained in:
Axel Kohlmeyer
2020-06-26 16:02:14 -04:00
parent a5651acb49
commit 41d62b8b8b
11 changed files with 81 additions and 146 deletions

View File

@ -16,6 +16,7 @@
#include "group.h"
#include "modify.h"
#include "error.h"
#include "fmt/format.h"
using namespace LAMMPS_NS;
using namespace FixConst;
@ -33,17 +34,11 @@ FixNVTSphere::FixNVTSphere(LAMMPS *lmp, int narg, char **arg) :
// create a new compute temp style
// id = fix-ID + temp
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/sphere";
modify->add_compute(3,newarg);
delete [] newarg;
cmd += fmt::format(" {} temp/sphere",group->names[igroup]);
modify->add_compute(cmd);
tcomputeflag = 1;
}