Commit 950442b8 authored by dstelter92's avatar dstelter92
Browse files

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

parent 1c68e42e
Loading
Loading
Loading
Loading
+28 −19
Original line number Diff line number Diff line
@@ -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,12 +223,15 @@ 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);
  }
}

/* ---------------------------------------------------------------------- */