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

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

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

revision 1028 by gross, Wed Mar 14 00:15:24 2007 UTC revision 1312 by ksteube, Mon Sep 24 06:18:44 2007 UTC
# Line 1  Line 1 
 /* $Id$ */  
1    
2    /* $Id$ */
3    
4  /*  /*******************************************************
5  ********************************************************************************   *
6  *               Copyright   2006 by ACcESS MNRF                                *   *           Copyright 2003-2007 by ACceSS MNRF
7  *                                                                              *   *       Copyright 2007 by University of Queensland
8  *                 http://www.access.edu.au                                     *   *
9  *           Primary Business: Queensland, Australia                            *   *                http://esscc.uq.edu.au
10  *     Licensed under the Open Software License version 3.0             *   *        Primary Business: Queensland, Australia
11  *        http://www.opensource.org/licenses/osl-3.0.php                        *   *  Licensed under the Open Software License version 3.0
12  ********************************************************************************   *     http://www.opensource.org/licenses/osl-3.0.php
13  */   *
14     *******************************************************/
15    
16  /**************************************************************/  /**************************************************************/
17    
# Line 36  void Paso_Solver_ILU_free(Paso_Solver_IL Line 37  void Paso_Solver_ILU_free(Paso_Solver_IL
37          MEMFREE(in->colorOf);          MEMFREE(in->colorOf);
38          MEMFREE(in->factors);          MEMFREE(in->factors);
39          MEMFREE(in->main_iptr);            MEMFREE(in->main_iptr);  
40          Paso_SystemMatrixPattern_dealloc(in->pattern);            Paso_Pattern_free(in->pattern);  
41          MEMFREE(in);          MEMFREE(in);
42       }       }
43  }  }
# Line 46  void Paso_Solver_ILU_free(Paso_Solver_IL Line 47  void Paso_Solver_ILU_free(Paso_Solver_IL
47  /*   constructs the incomplete block factorization of  /*   constructs the incomplete block factorization of
48    
49  */  */
50  Paso_Solver_ILU* Paso_Solver_getILU(Paso_SystemMatrix * A,bool_t verbose) {  Paso_Solver_ILU* Paso_Solver_getILU(Paso_SparseMatrix * A,bool_t verbose) {
51    dim_t n=A->num_rows;    dim_t n=A->numRows;
52    dim_t n_block=A->row_block_size;    dim_t n_block=A->row_block_size;
53    index_t num_colors=0, *mis_marker=NULL;    index_t num_colors=0, *mis_marker=NULL;
54    register double A11,A12,A13,A21,A22,A23,A31,A32,A33,D;    register double A11,A12,A13,A21,A22,A23,A31,A32,A33,D;
# Line 62  Paso_Solver_ILU* Paso_Solver_getILU(Paso Line 63  Paso_Solver_ILU* Paso_Solver_getILU(Paso
63    out->colorOf=MEMALLOC(n,index_t);    out->colorOf=MEMALLOC(n,index_t);
64    out->factors=MEMALLOC(A->len,double);    out->factors=MEMALLOC(A->len,double);
65    out->main_iptr=MEMALLOC(n,index_t);    out->main_iptr=MEMALLOC(n,index_t);
66    out->pattern=Paso_SystemMatrixPattern_reference(A->pattern);    out->pattern=Paso_Pattern_getReference(A->pattern);
67    out->n_block=n_block;    out->n_block=n_block;
68    out->n=n;    out->n=n;
69    time0=Paso_timer();    time0=Paso_timer();
# Line 75  Paso_Solver_ILU* Paso_Solver_getILU(Paso Line 76  Paso_Solver_ILU* Paso_Solver_getILU(Paso
76      while (Paso_Util_isAny(n,out->colorOf,-1) && Paso_noError()) {      while (Paso_Util_isAny(n,out->colorOf,-1) && Paso_noError()) {
77         #pragma omp parallel for private(i) schedule(static)         #pragma omp parallel for private(i) schedule(static)
78         for (i = 0; i < n; ++i) mis_marker[i]=out->colorOf[i];         for (i = 0; i < n; ++i) mis_marker[i]=out->colorOf[i];
79         Paso_SystemMatrixPattern_mis(A->pattern,mis_marker);         Paso_Pattern_mis(A->pattern,mis_marker);
80    
81         #pragma omp parallel for private(i) schedule(static)         #pragma omp parallel for private(i) schedule(static)
82         for (i = 0; i < n; ++i) if (mis_marker[i]) out->colorOf[i]=num_colors;         for (i = 0; i < n; ++i) if (mis_marker[i]) out->colorOf[i]=num_colors;

Legend:
Removed from v.1028  
changed lines
  Added in v.1312

  ViewVC Help
Powered by ViewVC 1.1.26