This commit is contained in:
Julien Guénolé 2017-06-30 18:35:59 +02:00
parent 885c0bbd4b
commit fe940abecf
3 changed files with 61 additions and 1 deletions

View File

@ -55,6 +55,14 @@ Min::Min(LAMMPS *lmp) : Pointers(lmp)
searchflag = 0;
linestyle = 1;
DELAYSTEP = 20;
DT_GROW = 1.1;
DT_SHRINK = 0.5;
ALPHA0 = 0.25;
ALPHA_SHRINK = 0.99;
TMAX = 2.0;
TMIN = 0.02;
elist_global = elist_atom = NULL;
vlist_global = vlist_atom = NULL;
@ -643,6 +651,50 @@ void Min::modify_params(int narg, char **arg)
if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command");
dmax = force->numeric(FLERR,arg[iarg+1]);
iarg += 2;
/* Wolfram
Hack: define some new parameters
DELAYSTEP 5
DT_GROW 1.1
DT_SHRINK 0.5
ALPHA0 0.1
ALPHA_SHRINK 0.99
TMAX 10.0
*/
} else if (strcmp(arg[iarg],"fire_delaystep") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command");
DELAYSTEP = force->numeric(FLERR,arg[iarg+1]);
if (comm->me == 0 && screen) fprintf(screen,"DELAYSTEP: %d \n", DELAYSTEP);
iarg += 2;
} else if (strcmp(arg[iarg],"fire_dt_grow") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command");
DT_GROW = force->numeric(FLERR,arg[iarg+1]);
if (comm->me == 0 && screen) fprintf(screen,"DT_GROW: %.8f \n", DT_GROW);
iarg += 2;
} else if (strcmp(arg[iarg],"fire_dt_shrink") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command");
DT_SHRINK = force->numeric(FLERR,arg[iarg+1]);
if (comm->me == 0 && screen) fprintf(screen,"DT_SHRINK: %.8f \n", DT_SHRINK);
iarg += 2;
} else if (strcmp(arg[iarg],"fire_alpha0") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command");
ALPHA0 = force->numeric(FLERR,arg[iarg+1]);
if (comm->me == 0 && screen) fprintf(screen,"ALPHA0: %.8f \n", ALPHA0);
iarg += 2;
} else if (strcmp(arg[iarg],"fire_alpha_shrink") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command");
ALPHA_SHRINK = force->numeric(FLERR,arg[iarg+1]);
if (comm->me == 0 && screen) fprintf(screen,"ALPHA_SHRINK: %.8f \n", ALPHA_SHRINK);
iarg += 2;
} else if (strcmp(arg[iarg],"fire_tmax") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command");
TMAX = force->numeric(FLERR,arg[iarg+1]);
if (comm->me == 0 && screen) fprintf(screen,"TMAX: %.8f \n", TMAX);
iarg += 2;
} else if (strcmp(arg[iarg],"fire_tmin") == 0) {
if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command");
TMAX = force->numeric(FLERR,arg[iarg+1]);
if (comm->me == 0 && screen) fprintf(screen,"TMIN: %.8f \n", TMAX);
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;

View File

@ -58,6 +58,12 @@ class Min : protected Pointers {
double dmax; // max dist to move any atom in one step
int linestyle; // 0 = backtrack, 1 = quadratic, 2 = forcezero
/* Wolframs include of FIRE parameters */
int DELAYSTEP; // FIRE parameters
double DT_GROW,DT_SHRINK;
double ALPHA0,ALPHA_SHRINK;
double TMAX,TMIN;
int nelist_global,nelist_atom; // # of PE,virial computes to check
int nvlist_global,nvlist_atom;
class Compute **elist_global; // lists of PE,virial Computes

View File

@ -27,6 +27,7 @@ using namespace LAMMPS_NS;
#define EPS_ENERGY 1.0e-8
/* Default values defined in min.cpp > Min::Min(LAMMPS *lmp) : Pointers(lmp)
#define DELAYSTEP 20
#define DT_GROW 1.1
#define DT_SHRINK 0.5
@ -34,6 +35,7 @@ using namespace LAMMPS_NS;
#define ALPHA_SHRINK 0.99
#define TMAX 2.0
#define TMIN 0.02 // as harcoded in IMD: 1/50
*/
/* ---------------------------------------------------------------------- */
@ -242,7 +244,7 @@ int MinAdaptGlok::iterate(int maxiter)
v[i][1] += dtfm * f[i][1];
v[i][2] += dtfm * f[i][2];
if (vdotfall > 0.0) {
// we perform the mixing AFTER the timeintegration
// we perform the mixing AFTER the velocity has been calculated
v[i][0] = scale1*v[i][0] + scale2*f[i][0];
v[i][1] = scale1*v[i][1] + scale2*f[i][1];
v[i][2] = scale1*v[i][2] + scale2*f[i][2];