/[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 2658 by artak, Mon Sep 7 05:04:45 2009 UTC revision 2659 by artak, Thu Sep 10 03:54:50 2009 UTC
# Line 35  Line 35 
35    
36  /* free all memory used by AMG                                */  /* free all memory used by AMG                                */
37    
38    void Paso_Solver_AMG_System_free(Paso_Solver_AMG_System * in) {
39         if (in!=NULL) {
40            Paso_Solver_AMG_free(in->amgblock1);
41            Paso_Solver_AMG_free(in->amgblock2);
42            Paso_Solver_AMG_free(in->amgblock3);
43            Paso_SparseMatrix_free(in->block1);
44            Paso_SparseMatrix_free(in->block2);
45            Paso_SparseMatrix_free(in->block3);
46    
47            MEMFREE(in);
48         }
49    }
50    
51    
52    /* free all memory used by AMG                                */
53    
54  void Paso_Solver_AMG_free(Paso_Solver_AMG * in) {  void Paso_Solver_AMG_free(Paso_Solver_AMG * in) {
55       if (in!=NULL) {       if (in!=NULL) {
56          Paso_Solver_AMG_free(in->AMG_of_Schur);          Paso_Solver_AMG_free(in->AMG_of_Schur);
# Line 160  Paso_Solver_AMG* Paso_Solver_getAMG(Paso Line 176  Paso_Solver_AMG* Paso_Solver_getAMG(Paso
176          }          }
177          else {          else {
178             /*Default coarseneing*/             /*Default coarseneing*/
179              /*Paso_Pattern_RS(A_p,mis_marker,options->coarsening_threshold);*/              Paso_Pattern_RS(A_p,mis_marker,options->coarsening_threshold);
180              Paso_Pattern_YS(A_p,mis_marker,options->coarsening_threshold);              /*Paso_Pattern_YS(A_p,mis_marker,options->coarsening_threshold);*/
181               /*Paso_Pattern_Aggregiation(A_p,mis_marker,options->coarsening_threshold);*/               /*Paso_Pattern_Aggregiation(A_p,mis_marker,options->coarsening_threshold);*/
182          }          }
183            
# Line 194  Paso_Solver_AMG* Paso_Solver_getAMG(Paso Line 210  Paso_Solver_AMG* Paso_Solver_getAMG(Paso
210                #pragma omp parallel for private(i,iPtr,j,S) schedule(static)                #pragma omp parallel for private(i,iPtr,j,S) schedule(static)
211                for (i = 0; i < out->n_F; ++i) {                for (i = 0; i < out->n_F; ++i) {
212                  S=0;                  S=0;
213  /*printf("%d : %d -> ",i, out->rows_in_F[i]);*/  /*printf("[%d ]: [%d] -> ",i, out->rows_in_F[i]);*/
214                  for (iPtr=A_p->pattern->ptr[out->rows_in_F[i]];iPtr<A_p->pattern->ptr[out->rows_in_F[i] + 1]; ++iPtr) {                  for (iPtr=A_p->pattern->ptr[out->rows_in_F[i]];iPtr<A_p->pattern->ptr[out->rows_in_F[i] + 1]; ++iPtr) {
215                   j=A_p->pattern->index[iPtr];                   j=A_p->pattern->index[iPtr];
216  /*if (j==out->rows_in_F[i]) printf("diagonal %e",A_p->val[iPtr]);*/  /*if (j==out->rows_in_F[i]) printf("diagonal %e",A_p->val[iPtr]);*/
217                   if (mis_marker[j] && j==out->rows_in_F[i])                   if (mis_marker[j])
218                       S=A_p->val[iPtr];                       S+=A_p->val[iPtr];
219                  }                  }
220  /*printf("-> %e\n",S);*/  /*printf("-> %e \n",S);*/
221                  out->inv_A_FF[i]=1./S;                  out->inv_A_FF[i]=1./S;
222                }                }
223             }             }

Legend:
Removed from v.2658  
changed lines
  Added in v.2659

  ViewVC Help
Powered by ViewVC 1.1.26