added check for nvt vs npt, enabled nvt simulation with fix_grem

This commit is contained in:
dstelter92 2016-11-15 21:53:28 -05:00
parent 1c68e42ecc
commit 950442b8b1
1 changed files with 28 additions and 19 deletions

View File

@ -188,6 +188,7 @@ void FixGrem::init()
pe = modify->compute[icompute];
int ifix = modify->find_fix(id_npt);
int nvtflag = 0;
if (ifix < 0)
error->all(FLERR,"Fix id for npt fix does not exist");
Fix *npt = modify->fix[ifix];
@ -202,6 +203,11 @@ void FixGrem::init()
error->all(FLERR,"Problem extracting target temperature from fix npt");
int *p_flag = (int *)npt->extract("p_flag",ifix);
if ((p_flag[0] == 0) && (p_flag[1] == 0) && (p_flag[2] == 0) && (ifix == 1)) {
pressref = 0.0;
nvtflag = 1;
}
else {
double *p_start = (double *) npt->extract("p_start",ifix);
double *p_stop = (double *) npt->extract("p_stop",ifix);
if ((p_flag != NULL) && (p_start != NULL) && (p_stop != NULL)
@ -217,11 +223,14 @@ void FixGrem::init()
error->all(FLERR,"Unsupported pressure settings in fix npt");
} else
error->all(FLERR,"Problem extracting target pressure from fix npt");
}
if (!nvtflag) {
char *modargs[2];
modargs[0] = (char *) "press";
modargs[1] = id_press;
npt->modify_param(2,modargs);
}
}
/* ---------------------------------------------------------------------- */