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

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

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

revision 3641 by jfenwick, Mon Oct 11 01:48:14 2010 UTC revision 3642 by caltinay, Thu Oct 27 03:41:51 2011 UTC
# Line 19  Line 19 
19  /**************************************************************/  /**************************************************************/
20    
21  /* Copyrights by ACcESS Australia 2003,2004,2005              */  /* Copyrights by ACcESS Australia 2003,2004,2005              */
22  /* Author: Lutz Gross, l.gross@uq.edu.au                                */  /* Author: Lutz Gross, l.gross@uq.edu.au                      */
23    
24  /**************************************************************/  /**************************************************************/
25    
# Line 40  void Paso_Solver_ILU_free(Paso_Solver_IL Line 40  void Paso_Solver_ILU_free(Paso_Solver_IL
40    
41  /**************************************************************/  /**************************************************************/
42    
43  /*   constructs the incomplete block factorization of  /*   constructs the incomplete block factorization            */
44    
 */  
45  Paso_Solver_ILU* Paso_Solver_getILU(Paso_SparseMatrix * A,bool_t verbose) {  Paso_Solver_ILU* Paso_Solver_getILU(Paso_SparseMatrix * A,bool_t verbose) {
46    const dim_t n=A->numRows;    const dim_t n=A->numRows;
47    const dim_t n_block=A->row_block_size;    const dim_t n_block=A->row_block_size;
# Line 301  Paso_Solver_ILU* Paso_Solver_getILU(Paso Line 300  Paso_Solver_ILU* Paso_Solver_getILU(Paso
300         time_fac=Esys_timer()-time0;         time_fac=Esys_timer()-time0;
301    }    }
302    if (Esys_noError()) {    if (Esys_noError()) {
303        if (verbose) printf("timing: ILU: coloring/elemination : %e sec\n",time_fac);        if (verbose) printf("timing: ILU: coloring/elimination: %e sec\n",time_fac);
304       return out;       return out;
305    } else  {    } else  {
306       Paso_Solver_ILU_free(out);       Paso_Solver_ILU_free(out);
# Line 311  Paso_Solver_ILU* Paso_Solver_getILU(Paso Line 310  Paso_Solver_ILU* Paso_Solver_getILU(Paso
310    
311  /**************************************************************/  /**************************************************************/
312    
313  /* apply ILU precondition b-> x                                /* Applies ILU precondition b-> x
   
      in fact it solves LUx=b in the form x= U^{-1} L^{-1}b  
314    
315   should be called within a parallel region                                                   In fact it solves LUx=b in the form x= U^{-1} L^{-1}b
  barrier synconization should be performed to make sure that the input vector available  
316    
317       Should be called within a parallel region.
318       Barrier synchronization should be performed to make sure that the input
319       vector is available.
320  */  */
321    
322  void Paso_Solver_solveILU(Paso_SparseMatrix * A, Paso_Solver_ILU * ilu, double * x, const double * b) {  void Paso_Solver_solveILU(Paso_SparseMatrix * A, Paso_Solver_ILU * ilu, double * x, const double * b) {
# Line 331  void Paso_Solver_solveILU(Paso_SparseMat Line 330  void Paso_Solver_solveILU(Paso_SparseMat
330       const index_t *ptr_main = Paso_SparseMatrix_borrowMainDiagonalPointer(A);       const index_t *ptr_main = Paso_SparseMatrix_borrowMainDiagonalPointer(A);
331            
332            
333       /* copy x into b*/       /* copy x into b */
334       #pragma omp parallel for private(i) schedule(static)       #pragma omp parallel for private(i) schedule(static)
335       for (i=0;i<n*n_block;++i) x[i]=b[i];       for (i=0;i<n*n_block;++i) x[i]=b[i];
336       /* forward substitution */       /* forward substitution */
# Line 467  void Paso_Solver_solveILU(Paso_SparseMat Line 466  void Paso_Solver_solveILU(Paso_SparseMat
466           }           }
467           #pragma omp barrier           #pragma omp barrier
468       }       }
      return;  
469  }  }
470    

Legend:
Removed from v.3641  
changed lines
  Added in v.3642

  ViewVC Help
Powered by ViewVC 1.1.26