Commit 89bddb06 authored by sjplimp's avatar sjplimp
Browse files

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@1746 f3b2605a-c512-4ea7-a41b-209d697bcdaa
parent 29c80c61
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -321,6 +321,7 @@ int MinCG::iterate(int n)
    if (dotall[0] < update->ftol * update->ftol) return FTOL;

    // update h from new f = -Grad(x) and old g
    // beta = dotall[0]/gg would be Fletcher-Reeves CG
    
    beta = MAX(0.0,(dotall[0] - dotall[1])/gg);
    gg = dotall[0];
@@ -495,7 +496,7 @@ void MinCG::force_clear()
------------------------------------------------------------------------- */

/* ----------------------------------------------------------------------
   linemin: backtracking line search (Alg 3.1, p 41 in Nocedal and Wright)
   linemin: backtracking line search (Proc 3.1, p 41 in Nocedal and Wright)
   uses no gradient info, but should be very robust
   start at maxdist, backtrack until energy decrease is sufficient
------------------------------------------------------------------------- */
@@ -507,7 +508,7 @@ int MinCG::linemin_backtrack(int n, double *x, double *dir, double eng,
  int i,ilist,m;
  double fdotdirme,fdotdirall,fme,fmax,eoriginal,alphamax;

  // stopping criterion
  // stopping criterion, must be scaled by normflag

  double *f = atom->f[0];
  fdotdirme = 0.0;
+2 −2
Original line number Diff line number Diff line
@@ -21,7 +21,7 @@

using namespace LAMMPS_NS;

#define EPS       1.0e-8
#define EPS_ENERGY 1.0e-8

enum{FAIL,MAXITER,MAXEVAL,ETOL,FTOL};   // same as in other min classes

@@ -62,7 +62,7 @@ int MinSD::iterate(int n)
    // energy tolerance criterion

    if (fabs(ecurrent-eprevious) <= 
	update->etol * 0.5*(fabs(ecurrent) + fabs(eprevious) + EPS))
	update->etol * 0.5*(fabs(ecurrent) + fabs(eprevious) + EPS_ENERGY))
      return ETOL;

    // force tolerance criterion