Commit c2e40091 authored by jguenole's avatar jguenole
Browse files

Remove option relaxbox from adaptglok: wrong behavior with non-P boundaries. Code cleanup.

parent 58d99f5e
Loading
Loading
Loading
Loading
+2 −32
Original line number Diff line number Diff line
@@ -26,8 +26,7 @@ keyword = {dmax} or {line} or {alpha_damp} or {discrete_factor}

these keywords apply only to the "min_style"_min_style.html {adaptglok} :ulb,l
keyword = {integrator} or {tmax} or {tmin} or {delaystep} or {dtgrow} or {dtshrink} 
          or {alpha0} or {alphashrink} or {relaxbox} or {relaxbox_mod} or {relaxbox_rate} 
          or {ptol} or {halfstepback} or {initialdelay} or {vdfmax}
          or {alpha0} or {alphashrink} or {halfstepback} or {initialdelay} or {vdfmax}
  {integrator} arg = {eulerimplicit} or {eulerexplicit} or {verlet} or {leapfrog}
    eulerimplicit,eulerexplicit,verlet,leapfrog = integration scheme
  {tmax} arg = coef
@@ -44,15 +43,6 @@ keyword = {integrator} or {tmax} or {tmin} or {delaystep} or {dtgrow} or {dtshri
    alpha = coefficient mixing velocities and forces
  {alphashrink} arg = shrink
    shrink = factor decreasing alpha
  {relaxbox} arg = {no} or {iso} or {aniso} or {x} or {y} or {z}
    no = no changes in box dimension (default)
    iso, aniso, x, y, z = type of box relaxation
  {relaxbox_mod} arg = modulus
    modulus = bulk modulus of the system, order of magnitude (pressure units)
  {relaxbox_rate} arg = rate
    rate = scaling factor to relax the box dimensions
  {ptol} arg = pressure
    pressure = threshold below which the box pressure is considered as null (pressure units)
  {vdfmax} arg = max 
    max = maximum number of consecutive iterations with P(t) < 0 before forced interruption 
  {halfstepback} arg = {yes} or {no}
@@ -62,7 +52,7 @@ keyword = {integrator} or {tmax} or {tmin} or {delaystep} or {dtgrow} or {dtshri
[Examples:]

min_modify dmax 0.2
min_modify integrator verlet tmax 0.4 relaxbox y relaxbox_mod 2e7 :pre
min_modify integrator verlet tmax 0.4 :pre

[Description:]

@@ -127,25 +117,6 @@ happen when the system comes to be stuck in a local basin of the phase space.
For debugging purposes, it is possible to switch off the inertia correction 
({halfstepback} = {no}) and the initial delay ({initialdelay} = {no}).

The style {adaptglok} performing a damped dynamics, it is not possible to use
"fix box/relax"_fix_box_relax.html to relax the simulation box.
Thus {adaptglok} implements a rudimentary box relaxation procedure that can be
controlled by the keywords {relaxbox}, {relaxbox_mod}, {relaxbox_rate} 
and {ptol}.
The argument {relaxbox} control in which directions the pressure is relaxed.
Note that the corresponding directions have to be periodic.
Note also that {relaxbox_mod} doesn't requires the exact value for the bulk modulus,
but rather the order of magnitude (in pressure "units"_units.html).
Ultimately, {relaxbox_mod} and {relaxbox_rate} 
control how fast the relaxation of the box is performed: lower values will slow
down the box relaxation but improve the stability of the procedure.

NOTE: the option {relaxbox} is currently experimental and often 
requires to tune the communication cutoff for ghost atoms with the command 
"comm_modify cutoff"_comm_modify.html. The value will depend on the expected
box variation and the number of cpu. A value from 2 to 3 times the current cutoff
(largest pair cutoff + neighbor skin) is often enough.

Keywords {alpha_damp} and {discrete_factor} only make sense when
a "min_spin"_min_spin.html command is declared. 
Keyword {alpha_damp} defines an analog of a magnetic Gilbert
@@ -168,5 +139,4 @@ Default values are {alpha_damp} = 1.0 and {discrete_factor} = 10.0.
The option defaults are dmax = 0.1, line = quadratic, 
integrator = eulerimplicit, tmax = 10.0, tmin = 0.02,
delaystep = 20, dtgrow = 1.1, dtshrink = 0.5, alpha0 = 0.25, alphashrink = 0.99,
relaxbox = no, relaxbox_mod = 1e6 and relaxbox_rate = 0.33, ptol = 0.1
vdfmax = 2000, halfstepback = yes and initialdelay = yes.
+1 −3
Original line number Diff line number Diff line
@@ -64,7 +64,7 @@ a minimization.

Style {adaptglok} is a re-implementation of the style {fire} with
additional optimizations of the method described
in "(Bitzek)"_#Bitzek.
in "(Bitzek)"_#Bitzek, including different time integration schemes.

Style {spin} is a damped spin dynamics with an adaptive 
timestep.
@@ -81,8 +81,6 @@ would normally use for dynamics simulations.
NOTE: The {quickmin}, {fire}, {adaptglok}, and {hftn} styles do not yet support the
use of the "fix box/relax"_fix_box_relax.html command or minimizations
involving the electron radius in "eFF"_pair_eff.html models. 
The {adaptglok} style actually support box relaxation by the implementation of
a basic relaxation scheme, see "min_modify"_min_modify.html.

[Restrictions:] none

+1 −2
Original line number Diff line number Diff line
@@ -64,8 +64,7 @@ backtracking method is described in Nocedal and Wright's Numerical
Optimization (Procedure 3.1 on p 41).

The "minimization styles"_min_style.html {quickmin}, {fire} and 
{adaptglok} perform damped dynamics using an Euler integration step. The style
{adaptglok} can also use a leapfrog or velocity Verlet integration step.
{adaptglok} perform damped dynamics using an Euler integration step.
Thus they require a "timestep"_timestep.html be defined.

NOTE: The damped dynamic minimizers use whatever timestep you have
+0 −42
Original line number Diff line number Diff line
@@ -66,11 +66,6 @@ Min::Min(LAMMPS *lmp) : Pointers(lmp)
  halfstepback_flag = 1;
  delaystep_start_flag = 1;
  max_vdotf_negatif = 2000;
  relaxbox_mod = 1000000;
  relaxbox_rate = 0.33;
  relaxbox_flag = 0;
  ptol = 0.1;
  p_flag[0] = p_flag[1] = p_flag[2] = 0;

  elist_global = elist_atom = NULL;
  vlist_global = vlist_atom = NULL;
@@ -725,43 +720,6 @@ 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;
        p_flag[0] = p_flag[1] = p_flag[2] = 1;
        if (dimension == 2) p_flag[2] = 0;
      } else if (strcmp(arg[iarg+1],"aniso") == 0) {
        relaxbox_flag = 2;
        p_flag[0] = p_flag[1] = p_flag[2] = 1;
        if (dimension == 2) p_flag[2] = 0;
      } else if (strcmp(arg[iarg+1],"x") == 0) {
        relaxbox_flag = 2;
        p_flag[0] = 1;
      } else if (strcmp(arg[iarg+1],"y") == 0) {
        relaxbox_flag = 2;
        p_flag[1] = 1;
      } else if (strcmp(arg[iarg+1],"z") == 0) {
        relaxbox_flag = 2;
        p_flag[2] = 1;
        if (dimension == 2)
          error->all(FLERR,"Invalid min_modify command for a 2d simulation");
      } else error->all(FLERR,"Illegal min_modify command");
      iarg += 2;       
    } else if (strcmp(arg[iarg],"relaxbox_mod") == 0) {
      if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command");
      relaxbox_mod = 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;
+0 −6
Original line number Diff line number Diff line
@@ -69,12 +69,6 @@ class Min : protected Pointers {
  int halfstepback_flag;      // half step backward when v.f <= 0.0
  int delaystep_start_flag;   // delay the initial dt_shrink
  int max_vdotf_negatif;      // maximum iteration with v.f > 0.0
  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
  double ptol;                // pressure threshold for boxrelax
  int p_flag[3];
  int dimension;

  int nelist_global,nelist_atom;    // # of PE,virial computes to check
  int nvlist_global,nvlist_atom;
Loading