git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@1746 f3b2605a-c512-4ea7-a41b-209d697bcdaa

This commit is contained in:
sjplimp
2008-04-14 22:13:25 +00:00
parent 29c80c6146
commit 89bddb0624
2 changed files with 6 additions and 5 deletions

View File

@ -321,7 +321,8 @@ 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;

View File

@ -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