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

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

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

revision 3314 by gross, Tue Oct 26 22:22:20 2010 UTC revision 3315 by gross, Wed Oct 27 01:20:27 2010 UTC
# Line 135  Paso_Preconditioner_LocalAMG* Paso_Preco Line 135  Paso_Preconditioner_LocalAMG* Paso_Preco
135                        
136            if ( n_F < n ) { /* if nothing is been removed we have a diagonal dominant matrix and we just run a few steps of the smoother */            if ( n_F < n ) { /* if nothing is been removed we have a diagonal dominant matrix and we just run a few steps of the smoother */
137        
138               /* creates index for F:*/              /* allocate helpers :*/
139                out->x_C=MEMALLOC(n_block*n_C,double);
140                out->b_C=MEMALLOC(n_block*n_C,double);
141                out->r=MEMALLOC(n_block*n,double);
142                
143                Esys_checkPtr(out->r);
144                Esys_checkPtr(out->Smoother);
145                Esys_checkPtr(out->x_C);
146                Esys_checkPtr(out->b_C);
147                
148                /* creates index for F:*/
149              #pragma omp parallel for private(i) schedule(static)              #pragma omp parallel for private(i) schedule(static)
150              for (i = 0; i < n; ++i) {              for (i = 0; i < n; ++i) {
151                 if  (split_marker[i]) rows_in_F[counter[i]]=i;                 if  (split_marker[i]) rows_in_F[counter[i]]=i;
# Line 160  Paso_Preconditioner_LocalAMG* Paso_Preco Line 170  Paso_Preconditioner_LocalAMG* Paso_Preco
170      /*            /*      
171                 construct Prolongation operator as transposed of restriction operator:                 construct Prolongation operator as transposed of restriction operator:
172              */              */
173              time0=Esys_timer();              if ( Esys_noError()) {
174              out->R=Paso_SparseMatrix_getTranspose(out->P);                 time0=Esys_timer();
175              if (SHOW_TIMING) printf("timing: level %d: Paso_SparseMatrix_getTranspose: %e\n",level,Esys_timer()-time0);                 out->R=Paso_SparseMatrix_getTranspose(out->P);
176                                       if (SHOW_TIMING) printf("timing: level %d: Paso_SparseMatrix_getTranspose: %e\n",level,Esys_timer()-time0);
177                }      
178              /*              /*
179              construct coarse level matrix:              construct coarse level matrix:
180              */              */
181              time0=Esys_timer();              if ( Esys_noError()) {
182              Atemp=Paso_SparseMatrix_MatrixMatrix(A_p,out->P);                 time0=Esys_timer();
183              A_C=Paso_SparseMatrix_MatrixMatrix(out->R,Atemp);                 Atemp=Paso_SparseMatrix_MatrixMatrix(A_p,out->P);
184              Paso_SparseMatrix_free(Atemp);                 A_C=Paso_SparseMatrix_MatrixMatrix(out->R,Atemp);
185              if (SHOW_TIMING) printf("timing: level %d : construct coarse matrix: %e\n",level,Esys_timer()-time0);                 Paso_SparseMatrix_free(Atemp);
186                               if (SHOW_TIMING) printf("timing: level %d : construct coarse matrix: %e\n",level,Esys_timer()-time0);            
187              /* allocate helpers :*/              }
188              out->x_C=MEMALLOC(n_block*n_C,double);  
             out->b_C=MEMALLOC(n_block*n_C,double);  
             out->r=MEMALLOC(n_block*n,double);  
               
             Esys_checkPtr(out->r);  
             Esys_checkPtr(out->Smoother);  
             Esys_checkPtr(out->x_C);  
             Esys_checkPtr(out->b_C);  
189                            
190              /*              /*
191                 constructe courser level:                 constructe courser level:
192                                
193              */              */
194              out->AMG_C=Paso_Preconditioner_LocalAMG_alloc(A_C,level+1,options);              if ( Esys_noError()) {
195                               out->AMG_C=Paso_Preconditioner_LocalAMG_alloc(A_C,level+1,options);
196                }
197              if ( Esys_noError()) {              if ( Esys_noError()) {
198                 if ( out->AMG_C == NULL ) {                 if ( out->AMG_C == NULL ) {
199                    out->reordering = options->reordering;                    out->reordering = options->reordering;

Legend:
Removed from v.3314  
changed lines
  Added in v.3315

  ViewVC Help
Powered by ViewVC 1.1.26