Commit 95cf85f1 authored by alxvov's avatar alxvov
Browse files

bug: forget to calculate beta..

parent fcf5e8c5
Loading
Loading
Loading
Loading
+2 −3
Changes for src/SPIN/min_spin_oso_cg.cpp: 2 added lines, 3 removed lines.
Original line number Diff line number Diff line
@@ -355,10 +355,9 @@ void MinSpinOSO_CG::calc_search_direction()
      MPI_Allreduce(&g2old,&g2old_global,1,MPI_DOUBLE,MPI_SUM,universe->uworld);
    }

    //if (fabs(g2_global) < 1.0e-40) beta = 0.0;
    //else beta = g2_global / g2old_global;
    if (fabs(g2_global) < 1.0e-60) beta = 0.0;
    else beta = g2_global / g2old_global;
    // calculate conjugate direction
    
    for (int i = 0; i < 3 * nlocal; i++) {
  	  p_s[i] = beta * p_s[i] - g_cur[i];
	  g_old[i] = g_cur[i];