git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@937 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
@ -169,9 +169,10 @@ FixNPT::FixNPT(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
char **newarg = new char*[3];
|
||||
newarg[0] = id_temp;
|
||||
newarg[1] = "all";
|
||||
if (strcmp(style,"npt") == 0) newarg[2] = "temp";
|
||||
else if (strcmp(style,"npt/asphere") == 0) newarg[2] = "temp/asphere";
|
||||
newarg[1] = (char *) "all";
|
||||
if (strcmp(style,"npt") == 0) newarg[2] = (char *) "temp";
|
||||
else if (strcmp(style,"npt/asphere") == 0)
|
||||
newarg[2] = (char *) "temp/asphere";
|
||||
modify->add_compute(3,newarg);
|
||||
delete [] newarg;
|
||||
tflag = 1;
|
||||
@ -187,8 +188,8 @@ FixNPT::FixNPT(LAMMPS *lmp, int narg, char **arg) :
|
||||
|
||||
newarg = new char*[4];
|
||||
newarg[0] = id_press;
|
||||
newarg[1] = "all";
|
||||
newarg[2] = "pressure";
|
||||
newarg[1] = (char *) "all";
|
||||
newarg[2] = (char *) "pressure";
|
||||
newarg[3] = id_temp;
|
||||
modify->add_compute(4,newarg);
|
||||
delete [] newarg;
|
||||
@ -240,7 +241,7 @@ void FixNPT::init()
|
||||
error->all("Cannot use fix npt without per-type mass defined");
|
||||
|
||||
// set temperature and pressure ptrs
|
||||
// set ptemperature only if pressure's id_pre is not id_temp
|
||||
// set ptemperature only if pressure's id_pre[0] is not id_temp
|
||||
|
||||
int icompute = modify->find_compute(id_temp);
|
||||
if (icompute < 0) error->all("Temp ID for fix npt does not exist");
|
||||
@ -250,9 +251,9 @@ void FixNPT::init()
|
||||
if (icompute < 0) error->all("Press ID for fix npt does not exist");
|
||||
pressure = modify->compute[icompute];
|
||||
|
||||
if (strcmp(id_temp,pressure->id_pre) == 0) ptemperature = NULL;
|
||||
if (strcmp(id_temp,pressure->id_pre[0]) == 0) ptemperature = NULL;
|
||||
else {
|
||||
icompute = modify->find_compute(pressure->id_pre);
|
||||
icompute = modify->find_compute(pressure->id_pre[0]);
|
||||
if (icompute < 0)
|
||||
error->all("Temp ID of press ID for fix npt does not exist");
|
||||
ptemperature = modify->compute[icompute];
|
||||
@ -761,13 +762,13 @@ int FixNPT::modify_param(int narg, char **arg)
|
||||
if (temperature->igroup != 0 && comm->me == 0)
|
||||
error->warning("Temperature for NPT is not for group all");
|
||||
|
||||
// reset id_pre of pressure to new temp ID
|
||||
// reset id_pre[0] of pressure to new temp ID
|
||||
|
||||
icompute = modify->find_compute(id_press);
|
||||
if (icompute < 0) error->all("Press ID for fix npt does not exist");
|
||||
delete [] modify->compute[icompute]->id_pre;
|
||||
modify->compute[icompute]->id_pre = new char[n];
|
||||
strcpy(modify->compute[icompute]->id_pre,id_temp);
|
||||
delete [] modify->compute[icompute]->id_pre[0];
|
||||
modify->compute[icompute]->id_pre[0] = new char[n];
|
||||
strcpy(modify->compute[icompute]->id_pre[0],id_temp);
|
||||
|
||||
return 2;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user