Commit a296c43d authored by Julien Guénolé's avatar Julien Guénolé
Browse files

flag to control the initial delay for dtshrink

parent 16934e4c
Loading
Loading
Loading
Loading
+7 −0
Changes for src/min.cpp: 7 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -64,6 +64,7 @@ Min::Min(LAMMPS *lmp) : Pointers(lmp)
  tmin = 0.02;
  integrator = 0;
  halfstepback_flag = 1;
  delaystep_start_flag = 1;
  relaxbox_mod = 1000000;
  relaxbox_rate = 0.33;
  relaxbox_flag = 0;
@@ -692,6 +693,12 @@ void Min::modify_params(int narg, char **arg)
      else if (strcmp(arg[iarg+1],"no") == 0) halfstepback_flag = 0;
      else error->all(FLERR,"Illegal min_modify command");
      iarg += 2;       
    } else if (strcmp(arg[iarg],"initialdelay") == 0) {
      if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command");
      if (strcmp(arg[iarg+1],"yes") == 0) delaystep_start_flag = 1;
      else if (strcmp(arg[iarg+1],"no") == 0) delaystep_start_flag = 0;
      else error->all(FLERR,"Illegal min_modify command");
      iarg += 2;       
    } else if (strcmp(arg[iarg],"integrator") == 0) {
      if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command");
      if (strcmp(arg[iarg+1],"eulerimplicit") == 0) integrator = 0;
+1 −0
Changes for src/min.h: 1 added line, 0 removed lines.
Original line number Diff line number Diff line
@@ -65,6 +65,7 @@ class Min : protected Pointers {
  double tmax,tmin;           // timestep multiplicators max, min
  int integrator;             // Newton integration: euler, leapfrog, verlet...
  int halfstepback_flag;      // half step backward when v.f <= 0.0
  int delaystep_start_flag;   // delay the initial dt_shrink
  double relaxbox_mod;        // Bulk modulus used for box relax
  double relaxbox_rate;       // for box relaxation to 0 pressure
  int relaxbox_flag;          // 1: box relaxation iso; 2: aniso
+4 −1
Changes for src/min_adaptglok.cpp: 4 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -315,7 +315,10 @@ int MinAdaptGlok::iterate(int maxiter)

    } else {
      last_negative = ntimestep;
      if (ntimestep - ntimestep_start > delaystep) {
      int delayflag = 1;
      if (ntimestep - ntimestep_start < delaystep && delaystep_start_flag)
        delayflag = 0;
      if (delayflag) {
        alpha = alpha0;
        if (dt*dtshrink >= dtmin) {
          dt *= dtshrink;