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

partially adding boxrelax

parent a438d2c8
Loading
Loading
Loading
Loading
+21 −0
Changes for src/min.cpp: 21 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -64,6 +64,8 @@ Min::Min(LAMMPS *lmp) : Pointers(lmp)
  tmin = 0.02;
  integrator = 0;
  halfstepback_flag = 1;
  relaxbox_flag = 0;
  ptol = 1e-5;

  elist_global = elist_atom = NULL;
  vlist_global = vlist_atom = NULL;
@@ -695,6 +697,25 @@ void Min::modify_params(int narg, char **arg)
      else if (strcmp(arg[iarg+1],"eulerexplicit") == 0) integrator = 3;
      else error->all(FLERR,"Illegal min_modify command");
      iarg += 2;
    } else if (strcmp(arg[iarg],"relaxbox") == 0) {
      if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command");
      if (strcmp(arg[iarg+1],"no") == 0) relaxbox_flag = 0;
      else if (strcmp(arg[iarg+1],"iso") == 0) relaxbox_flag = 1;
      else if (strcmp(arg[iarg+1],"axial") == 0) relaxbox_flag = 2;
      else error->all(FLERR,"Illegal min_modify command");
      iarg += 2;       
    } else if (strcmp(arg[iarg],"relaxbox_modulus") == 0) {
      if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command");
      relaxbox_modulus = force->numeric(FLERR,arg[iarg+1]);
      iarg += 2;       
    } else if (strcmp(arg[iarg],"relaxbox_rate") == 0) {
      if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command");
      relaxbox_rate = force->numeric(FLERR,arg[iarg+1]);
      iarg += 2;        
    } else if (strcmp(arg[iarg],"ptol") == 0) {
      if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command");
      ptol = force->numeric(FLERR,arg[iarg+1]);
      iarg += 2;        
    } else if (strcmp(arg[iarg],"line") == 0) {
      if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command");
      if (strcmp(arg[iarg+1],"backtrack") == 0) linestyle = 0;
+5 −1
Changes for src/min.h: 5 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -58,13 +58,17 @@ class Min : protected Pointers {
  double dmax;                // max dist to move any atom in one step
  int linestyle;              // 0 = backtrack, 1 = quadratic, 2 = forcezero

  // only for min_adaptglok
  // only for minimize style adaptglok
  int delaystep;              // minium steps of dynamics
  double dtgrow,dtshrink;     // timestep increase, decrease 
  double alpha0,alphashrink;  // mixing velocities+forces coefficient
  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
  double relaxbox_modulus;    // Bulk modulus used for box relax
  double relaxbox_rate;       // for box relaxation to 0 pressure
  int relaxbox_flag;          // 1: box relaxation iso; 2: axial
  double ptol;                // pressure threshold for boxrelax

  int nelist_global,nelist_atom;    // # of PE,virial computes to check
  int nvlist_global,nvlist_atom;
+3 −0
Changes for src/min_adaptglok.h: 3 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -37,6 +37,9 @@ class MinAdaptGlok : public Min {
  double dt,dtmax,dtmin,dtinit;
  double alpha;
  bigint last_negative,ntimestep_start;
  int pflag;
  class Compute *temperature,*pressure;
  double boxlo[3],h_inv[6];
};

}