/[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 2509 by artak, Thu Jul 2 04:51:51 2009 UTC revision 2520 by artak, Mon Jul 6 03:13:11 2009 UTC
# Line 74  to Line 74  to
74     then AMG is applied to S again until S becomes empty     then AMG is applied to S again until S becomes empty
75    
76  */  */
77  Paso_Solver_AMG* Paso_Solver_getAMG(Paso_SparseMatrix *A_p,bool_t verbose,dim_t level, double coarsening_threshold, dim_t coarsening_method) {  Paso_Solver_AMG* Paso_Solver_getAMG(Paso_SparseMatrix *A_p,dim_t level,Paso_Options* options) {
78    Paso_Solver_AMG* out=NULL;    Paso_Solver_AMG* out=NULL;
79      bool_t verbose=options->verbose;
80    dim_t n=A_p->numRows;    dim_t n=A_p->numRows;
81    dim_t n_block=A_p->row_block_size;    dim_t n_block=A_p->row_block_size;
82    index_t* mis_marker=NULL;      index_t* mis_marker=NULL;  
# Line 120  Paso_Solver_AMG* Paso_Solver_getAMG(Paso Line 121  Paso_Solver_AMG* Paso_Solver_getAMG(Paso
121       #pragma omp parallel for private(i) schedule(static)       #pragma omp parallel for private(i) schedule(static)
122       for (i=0;i<n;++i) mis_marker[i]=-1;       for (i=0;i<n;++i) mis_marker[i]=-1;
123            
124       if (coarsening_method == PASO_YAIR_SHAPIRA_COARSENING) {       if (options->coarsening_method == PASO_YAIR_SHAPIRA_COARSENING) {
125        Paso_Pattern_coup(A_p,mis_marker,coarsening_threshold);        Paso_Pattern_coup(A_p,mis_marker,options->coarsening_threshold);
126       }       }
127       else if (coarsening_method == PASO_RUGE_STUEBEN_COARSENING) {       else if (options->coarsening_method == PASO_RUGE_STUEBEN_COARSENING) {
128        Paso_Pattern_RS(A_p,mis_marker,coarsening_threshold);        Paso_Pattern_RS(A_p,mis_marker,options->coarsening_threshold);
129       }       }
130       else if (coarsening_method == PASO_AGGREGATION_COARSENING) {       else if (options->coarsening_method == PASO_AGGREGATION_COARSENING) {
131        Paso_Pattern_Aggregiation(A_p,mis_marker,coarsening_threshold);        Paso_Pattern_Aggregiation(A_p,mis_marker,options->coarsening_threshold);
132       }       }
133       else {       else {
134        /*Default coarseneing*/        /*Default coarseneing*/
135        Paso_Pattern_RS(A_p,mis_marker,coarsening_threshold);        Paso_Pattern_RS(A_p,mis_marker,options->coarsening_threshold);
136       }       }
137    
138      if (Paso_noError()) {      if (Paso_noError()) {
# Line 224  Paso_Solver_AMG* Paso_Solver_getAMG(Paso Line 225  Paso_Solver_AMG* Paso_Solver_getAMG(Paso
225                              }                                                              }                                
226                              if (Paso_noError()) {                              if (Paso_noError()) {
227                                  Paso_Solver_updateIncompleteSchurComplement(schur_withFillIn,out->A_CF,out->inv_A_FF,out->A_FF_pivot,out->A_FC);                                  Paso_Solver_updateIncompleteSchurComplement(schur_withFillIn,out->A_CF,out->inv_A_FF,out->A_FF_pivot,out->A_FC);
228                                  out->AMG_of_Schur=Paso_Solver_getAMG(schur_withFillIn,verbose,level-1,coarsening_threshold,coarsening_method);                                  out->AMG_of_Schur=Paso_Solver_getAMG(schur_withFillIn,level-1,options);
229                                  Paso_SparseMatrix_free(schur);                                  Paso_SparseMatrix_free(schur);
230                              }                              }
231                              /* allocate work arrays for AMG application */                              /* allocate work arrays for AMG application */

Legend:
Removed from v.2509  
changed lines
  Added in v.2520

  ViewVC Help
Powered by ViewVC 1.1.26