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

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

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

revision 2803 by artak, Thu Dec 3 05:35:20 2009 UTC revision 2816 by artak, Thu Dec 10 02:09:43 2009 UTC
# Line 163  Paso_Solver_AMG* Paso_Solver_getAMG(Paso Line 163  Paso_Solver_AMG* Paso_Solver_getAMG(Paso
163       out->b_C=NULL;       out->b_C=NULL;
164       out->GS=NULL;       out->GS=NULL;
165       out->A=Paso_SparseMatrix_getReference(A_p);       out->A=Paso_SparseMatrix_getReference(A_p);
      out->GS=NULL;  
166       out->solver=NULL;       out->solver=NULL;
167       /*out->GS=Paso_Solver_getGS(A_p,verbose);*/       /*out->GS=Paso_Solver_getGS(A_p,verbose);*/
168       out->level=level;       out->level=level;
# Line 220  Paso_Solver_AMG* Paso_Solver_getAMG(Paso Line 219  Paso_Solver_AMG* Paso_Solver_getAMG(Paso
219           else if (options->coarsening_method == PASO_AGGREGATION_COARSENING) {           else if (options->coarsening_method == PASO_AGGREGATION_COARSENING) {
220               Paso_Pattern_Aggregiation(A_p,mis_marker,options->coarsening_threshold);               Paso_Pattern_Aggregiation(A_p,mis_marker,options->coarsening_threshold);
221          }          }
222            else if (options->coarsening_method == PASO_STANDARD_COARSENING) {
223                 Paso_Pattern_Standard(A_p,mis_marker,options->coarsening_threshold);
224            }
225          else {          else {
226             /*Default coarseneing*/             /*Default coarseneing*/
227              Paso_Pattern_RS_MI_Aggressive(A_p,mis_marker,options->coarsening_threshold);              /*Paso_Pattern_RS_MI_Aggressive(A_p,mis_marker,options->coarsening_threshold);*/
228              /*Paso_Pattern_RS_MI(A_p,mis_marker,options->coarsening_threshold);*/              Paso_Pattern_Standard(A_p,mis_marker,options->coarsening_threshold);
229              /*Paso_Pattern_YS(A_p,mis_marker,options->coarsening_threshold);*/              /*Paso_Pattern_YS(A_p,mis_marker,options->coarsening_threshold);*/
230              /*Paso_Pattern_RS(A_p,mis_marker,options->coarsening_threshold);*/              /*Paso_Pattern_RS(A_p,mis_marker,options->coarsening_threshold);*/
231                /*Paso_Pattern_greedy(A_p->pattern,mis_marker);*/
232              /*Paso_Pattern_Aggregiation(A_p,mis_marker,options->coarsening_threshold);*/              /*Paso_Pattern_Aggregiation(A_p,mis_marker,options->coarsening_threshold);*/
233                            
234          }          }
# Line 284  Paso_Solver_AMG* Paso_Solver_getAMG(Paso Line 287  Paso_Solver_AMG* Paso_Solver_getAMG(Paso
287                   }                   }
288                }                }
289                                
290                 /*if(level==1) {                /* if(level==1) {
291                     printf("##TOTAL: %d, ELIMINATED: %d\n",n,out->n_F);                     printf("##TOTAL: %d, ELIMINATED: %d\n",n,out->n_F);
292                     for (i = 0; i < n; ++i) {                     for (i = 0; i < n; ++i) {
293                      printf("##%d %d\n",i,mis_marker[i]);                      printf("##%d %d\n",i,mis_marker[i]);
294                     }                     }
295                   }                  }
296                 */                */
297                  
298                /*check whether coarsening process actually makes sense to continue.                /*check whether coarsening process actually makes sense to continue.
299                if coarse matrix at least smaller by 30% then continue, otherwise we stop.*/                if coarse matrix at least smaller by 30% then continue, otherwise we stop.*/
300                if ((out->n_F*100/n)<30) {                if ((out->n_F*100/n)<30) {
# Line 513  void Paso_Solver_solveAMG(Paso_Solver_AM Line 517  void Paso_Solver_solveAMG(Paso_Solver_AM
517           Paso_Solver_solveJacobi(amg->GS,x,b);           Paso_Solver_solveJacobi(amg->GS,x,b);
518                    
519          /***********/          /***********/
520          #pragma omp parallel for private(i) schedule(static)          if (pre_sweeps>1) {
521          for (i=0;i<amg->n;++i) r[i]=b[i];              #pragma omp parallel for private(i) schedule(static)
522                for (i=0;i<amg->n;++i) r[i]=b[i];
523            }
524        
525          while(pre_sweeps>1) {          while(pre_sweeps>1) {
526             #pragma omp parallel for private(i) schedule(static)             #pragma omp parallel for private(i) schedule(static)
527             for (i=0;i<amg->n;++i) r[i]+=b[i];             for (i=0;i<amg->n;++i) r[i]+=b[i];
528                        
529              /* Compute the residual b=b-Ax*/              /* Compute the residual r=r-Ax*/
530             Paso_SparseMatrix_MatrixVector_CSR_OFFSET0(-1.,amg->A,x,1.,r);             Paso_SparseMatrix_MatrixVector_CSR_OFFSET0(-1.,amg->A,x,1.,r);
531             /* Go round again*/             /* Go round again*/
532             Paso_Solver_solveJacobi(amg->GS,x,r);             Paso_Solver_solveJacobi(amg->GS,x,r);

Legend:
Removed from v.2803  
changed lines
  Added in v.2816

  ViewVC Help
Powered by ViewVC 1.1.26