/[escript]/trunk/paso/src/GMRES.c
ViewVC logotype

Diff of /trunk/paso/src/GMRES.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 415 by gross, Wed Jan 4 05:37:33 2006 UTC revision 584 by gross, Thu Mar 9 23:03:38 2006 UTC
# Line 56  err_t Paso_Solver_GMRES( Line 56  err_t Paso_Solver_GMRES(
56      double * r,      double * r,
57      double * x,      double * x,
58      dim_t *iter,      dim_t *iter,
59      double * tolerance,dim_t Length_of_recursion,dim_t restart) {      double * tolerance,dim_t Length_of_recursion,dim_t restart,
60        Paso_Performance* pp) {
61    
62    /* Local variables */    /* Local variables */
63    
# Line 136  err_t Paso_Solver_GMRES( Line 137  err_t Paso_Solver_GMRES(
137           /***                                                                           /***                                                                
138           *** calculate new search direction P from R_PRES           *** calculate new search direction P from R_PRES
139           ***/           ***/
140             #pragma omp barrier
141           Paso_Solver_solvePreconditioner(A,&P_PRES[0][0], &R_PRES[0][0]);           Paso_Solver_solvePreconditioner(A,&P_PRES[0][0], &R_PRES[0][0]);
142           /***                                                                           /***                                                                
143           *** apply A to P to get AP           *** apply A to P to get AP
144           ***/           ***/
145             #pragma omp barrier
146       Paso_SystemMatrix_MatrixVector_CSR_OFFSET0(ONE, A, &P_PRES[0][0],ZERO, &AP[0]);       Paso_SystemMatrix_MatrixVector_CSR_OFFSET0(ONE, A, &P_PRES[0][0],ZERO, &AP[0]);
147           /***                                                                           /***                                                                
148           ***** calculation of the norm of R and the scalar products of                 ***** calculation of the norm of R and the scalar products of      
# Line 352  err_t Paso_Solver_GMRES( Line 355  err_t Paso_Solver_GMRES(
355           /* this fixes a problem with the intel compiler */           /* this fixes a problem with the intel compiler */
356           #pragma omp master           #pragma omp master
357           P_PRES_dot_AP0=R_PRES_dot_P_PRES[0];           P_PRES_dot_AP0=R_PRES_dot_P_PRES[0];
          #pragma omp barrier  
358           /***   if sum_BREAKF is equal to zero a breakdown occurs.           /***   if sum_BREAKF is equal to zero a breakdown occurs.
359            ***   iteration procedure can be continued but R_PRES is not the            ***   iteration procedure can be continued but R_PRES is not the
360            ***   residual of X_PRES approximation.            ***   residual of X_PRES approximation.
361            ***/            ***/
362             #pragma omp barrier
363           sum_BREAKF=0.;           sum_BREAKF=0.;
364           for (i=0;i<order;++i) sum_BREAKF +=BREAKF[i];           for (i=0;i<order;++i) sum_BREAKF +=BREAKF[i];
365           breakFlag=!((ABS(P_PRES_dot_AP0) > ZERO) &&  (sum_BREAKF >ZERO));           breakFlag=!((ABS(P_PRES_dot_AP0) > ZERO) &&  (sum_BREAKF >ZERO));
# Line 563  err_t Paso_Solver_GMRES( Line 566  err_t Paso_Solver_GMRES(
566    }    }
567    return Status;    return Status;
568  }  }
   

Legend:
Removed from v.415  
changed lines
  Added in v.584

  ViewVC Help
Powered by ViewVC 1.1.26