Skip to content
Snippets Groups Projects
Commit 950442b8 authored by dstelter92's avatar dstelter92
Browse files

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

parent 1c68e42e
No related branches found
No related tags found
No related merge requests found
...@@ -188,6 +188,7 @@ void FixGrem::init() ...@@ -188,6 +188,7 @@ void FixGrem::init()
pe = modify->compute[icompute]; pe = modify->compute[icompute];
int ifix = modify->find_fix(id_npt); int ifix = modify->find_fix(id_npt);
int nvtflag = 0;
if (ifix < 0) if (ifix < 0)
error->all(FLERR,"Fix id for npt fix does not exist"); error->all(FLERR,"Fix id for npt fix does not exist");
Fix *npt = modify->fix[ifix]; Fix *npt = modify->fix[ifix];
...@@ -202,26 +203,34 @@ void FixGrem::init() ...@@ -202,26 +203,34 @@ void FixGrem::init()
error->all(FLERR,"Problem extracting target temperature from fix npt"); error->all(FLERR,"Problem extracting target temperature from fix npt");
int *p_flag = (int *)npt->extract("p_flag",ifix); int *p_flag = (int *)npt->extract("p_flag",ifix);
double *p_start = (double *) npt->extract("p_start",ifix); if ((p_flag[0] == 0) && (p_flag[1] == 0) && (p_flag[2] == 0) && (ifix == 1)) {
double *p_stop = (double *) npt->extract("p_stop",ifix); pressref = 0.0;
if ((p_flag != NULL) && (p_start != NULL) && (p_stop != NULL) nvtflag = 1;
&& (ifix == 1)) { }
ifix = 0; else {
pressref = p_start[0]; double *p_start = (double *) npt->extract("p_start",ifix);
if ((p_start[0] != p_stop[0]) || (p_flag[0] != 1)) ++ ifix; double *p_stop = (double *) npt->extract("p_stop",ifix);
if ((p_start[1] != p_stop[1]) || (p_flag[0] != 1)) ++ ifix; if ((p_flag != NULL) && (p_start != NULL) && (p_stop != NULL)
if ((p_start[2] != p_stop[2]) || (p_flag[0] != 1)) ++ ifix; && (ifix == 1)) {
if ((p_start[0] != p_start[1]) || (p_start[1] != p_start[2])) ++ifix; ifix = 0;
if ((p_flag[3] != 0) || (p_flag[4] != 0) || (p_flag[5] != 0)) ++ifix; pressref = p_start[0];
if (ifix > 0) if ((p_start[0] != p_stop[0]) || (p_flag[0] != 1)) ++ ifix;
error->all(FLERR,"Unsupported pressure settings in fix npt"); if ((p_start[1] != p_stop[1]) || (p_flag[0] != 1)) ++ ifix;
} else if ((p_start[2] != p_stop[2]) || (p_flag[0] != 1)) ++ ifix;
error->all(FLERR,"Problem extracting target pressure from fix npt"); if ((p_start[0] != p_start[1]) || (p_start[1] != p_start[2])) ++ifix;
if ((p_flag[3] != 0) || (p_flag[4] != 0) || (p_flag[5] != 0)) ++ifix;
if (ifix > 0)
error->all(FLERR,"Unsupported pressure settings in fix npt");
} else
error->all(FLERR,"Problem extracting target pressure from fix npt");
}
char *modargs[2]; if (!nvtflag) {
modargs[0] = (char *) "press"; char *modargs[2];
modargs[1] = id_press; modargs[0] = (char *) "press";
npt->modify_param(2,modargs); modargs[1] = id_press;
npt->modify_param(2,modargs);
}
} }
/* ---------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment