Made line quadratic default and changed backtrack alpha zero check to be more friendly

git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@12531 f3b2605a-c512-4ea7-a41b-209d697bcdaa
This commit is contained in:
athomps 2014-09-24 00:45:19 +00:00
parent edd0d2dea7
commit 463db58583
2 changed files with 8 additions and 4 deletions

View File

@ -53,7 +53,7 @@ Min::Min(LAMMPS *lmp) : Pointers(lmp)
{
dmax = 0.1;
searchflag = 0;
linestyle = 0;
linestyle = 1;
elist_global = elist_atom = NULL;
vlist_global = vlist_atom = NULL;

View File

@ -48,6 +48,7 @@ using namespace LAMMPS_NS;
#define ALPHA_REDUCE 0.5
#define BACKTRACK_SLOPE 0.4
#define QUADRATIC_TOL 0.1
//#define EMACH 1.0e-8
#define EMACH 1.0e-8
#define EPS_QUAD 1.0e-28
@ -277,12 +278,15 @@ int MinLineSearch::linemin_backtrack(double eoriginal, double &alpha)
alpha *= ALPHA_REDUCE;
// backtracked all the way to 0.0
// reset to starting point, exit with error
// backtracked too much
// reset to starting point
// if de is positive, exit with error
// if de is negative, exit with ETOL
if (alpha <= 0.0 || de_ideal >= -EMACH) {
ecurrent = alpha_step(0.0,0);
return ZEROALPHA;
if (de < 0.0) return ETOL;
else return ZEROALPHA;
}
}
}