Commit 8ab5bfa1 by Francois Gygi

Fix force_tol and stress_tol convergence test in BOSampleStepper.C

parent a7c71579
......@@ -1240,17 +1240,22 @@ void BOSampleStepper::step(int niter)
if ( atoms_move )
s_.constraints.update_constraints(dt);
// check if maxforce and maxstress within tolerance
if ( onpe0 )
// if using force_tol or stress_tol, check if maxforce and maxstress
// within tolerance
if ( force_tol > 0.0 )
{
if ( force_tol > 0.0 )
if ( onpe0 )
cout << " maxforce: " << scientific
<< setprecision(4) << maxforce << endl;
if ( stress_tol > 0.0 )
<< setprecision(4) << maxforce << fixed << endl;
iter_done |= ( maxforce < force_tol );
}
if ( stress_tol > 0.0 )
{
if ( onpe0 )
cout << " maxstress: " << scientific
<< setprecision(4) << maxstress << endl;
<< setprecision(4) << maxstress << fixed << endl;
iter_done |= ( maxstress < stress_tol );
}
iter_done = ( maxforce < force_tol ) && ( maxstress < stress_tol );
// print iteration time
double time = tm_iter.real();
......
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