Commit 2b440110 by Francois Gygi

Reduced alpha_max to 5.0

Rescale alpha when displacement exceeds limit


git-svn-id: http://qboxcode.org/svn/qb/trunk@1758 cba15fb0-1239-40c8-b417-11db7ca47a34
parent 3549436b
...@@ -25,7 +25,7 @@ CGIonicStepper::CGIonicStepper(Sample& s) : IonicStepper(s), ...@@ -25,7 +25,7 @@ CGIonicStepper::CGIonicStepper(Sample& s) : IonicStepper(s),
cgopt_(CGOptimizer(3*natoms_)) cgopt_(CGOptimizer(3*natoms_))
{ {
cgopt_.set_alpha_start(1.0); cgopt_.set_alpha_start(1.0);
cgopt_.set_alpha_max(10.0); cgopt_.set_alpha_max(5.0);
cgopt_.set_beta_max(10.0); cgopt_.set_beta_max(10.0);
#ifdef DEBUG #ifdef DEBUG
if ( s.ctxt_.onpe0() ) if ( s.ctxt_.onpe0() )
...@@ -72,8 +72,11 @@ void CGIonicStepper::compute_r(double e0, const vector<vector<double> >& f0) ...@@ -72,8 +72,11 @@ void CGIonicStepper::compute_r(double e0, const vector<vector<double> >& f0)
if ( s_.ctxt_.onpe0() ) if ( s_.ctxt_.onpe0() )
cout << " CGIonicStepper: displacement exceeds limit, rescaling" << endl; cout << " CGIonicStepper: displacement exceeds limit, rescaling" << endl;
// rescale displacement and reset the CG optimizer // rescale displacement and reset the CG optimizer
xp = x + (max_disp/largest_disp) * (xp - x); double fac = max_disp/largest_disp;
xp = x + fac * (xp - x);
// reduce alpha starting value in CG optmizer
cgopt_.set_alpha_start(fac*cgopt_.alpha_start());
cgopt_.reset(); cgopt_.reset();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment