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

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

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

trunk/paso/src/Solvers/Solver_preconditioner.c revision 425 by gross, Tue Jan 10 04:10:39 2006 UTC trunk/paso/src/Solver_preconditioner.c revision 1388 by trankine, Fri Jan 11 07:45:58 2008 UTC
# Line 1  Line 1 
1    
2  /* $Id$ */  /* $Id$ */
3    
4    /*******************************************************
5     *
6     *           Copyright 2003-2007 by ACceSS MNRF
7     *       Copyright 2007 by University of Queensland
8     *
9     *                http://esscc.uq.edu.au
10     *        Primary Business: Queensland, Australia
11     *  Licensed under the Open Software License version 3.0
12     *     http://www.opensource.org/licenses/osl-3.0.php
13     *
14     *******************************************************/
15    
16  /**************************************************************/  /**************************************************************/
17    
18  /* Paso: SystemMatrix: sets-up the preconditioner           */  /* Paso: SystemMatrix: sets-up the preconditioner           */
# Line 22  Line 35 
35  void Paso_Preconditioner_free(Paso_Solver_Preconditioner* in) {  void Paso_Preconditioner_free(Paso_Solver_Preconditioner* in) {
36      if (in!=NULL) {      if (in!=NULL) {
37        Paso_Solver_ILU_free(in->ilu);        Paso_Solver_ILU_free(in->ilu);
38          Paso_Solver_RILU_free(in->rilu);
39        Paso_Solver_Jacobi_free(in->jacobi);        Paso_Solver_Jacobi_free(in->jacobi);
40        MEMFREE(in);        MEMFREE(in);
41      }      }
# Line 35  void Paso_Solver_setPreconditioner(Paso_ Line 49  void Paso_Solver_setPreconditioner(Paso_
49          prec=MEMALLOC(1,Paso_Solver_Preconditioner);          prec=MEMALLOC(1,Paso_Solver_Preconditioner);
50          if (Paso_checkPtr(prec)) return;          if (Paso_checkPtr(prec)) return;
51          prec->type=UNKNOWN;          prec->type=UNKNOWN;
52            prec->rilu=NULL;
53          prec->ilu=NULL;          prec->ilu=NULL;
54          prec->jacobi=NULL;          prec->jacobi=NULL;
55          A->solver=prec;          A->solver=prec;
# Line 42  void Paso_Solver_setPreconditioner(Paso_ Line 57  void Paso_Solver_setPreconditioner(Paso_
57             default:             default:
58             case PASO_JACOBI:             case PASO_JACOBI:
59                if (options->verbose) printf("Jacobi preconditioner is used.\n");                if (options->verbose) printf("Jacobi preconditioner is used.\n");
60                prec->jacobi=Paso_Solver_getJacobi(A);                prec->jacobi=Paso_Solver_getJacobi(A->mainBlock);
61                prec->type=PASO_JACOBI;                prec->type=PASO_JACOBI;
62                break;                break;
63             case PASO_ILU0:             case PASO_ILU0:
64                if (options->verbose) printf("ILU preconditioner is used.\n");                if (options->verbose) printf("ILU preconditioner is used.\n");
65                prec->ilu=Paso_Solver_getILU(A,options->verbose);                prec->ilu=Paso_Solver_getILU(A->mainBlock,options->verbose);
66                prec->type=PASO_ILU0;                prec->type=PASO_ILU0;
67                break;                break;
68               case PASO_RILU:
69                  if (options->verbose) printf("RILU preconditioner is used.\n");
70                  prec->rilu=Paso_Solver_getRILU(A->mainBlock,options->verbose);
71                  prec->type=PASO_RILU;
72                  break;
73          }          }
74          if (! Paso_noError()) {          if (! Paso_MPIInfo_noError(A->mpi_info ) ){
75             Paso_Preconditioner_free(prec);             Paso_Preconditioner_free(prec);
76             A->solver=NULL;             A->solver=NULL;
77          }          }
# Line 72  void Paso_Solver_solvePreconditioner(Pas Line 92  void Paso_Solver_solvePreconditioner(Pas
92          case PASO_ILU0:          case PASO_ILU0:
93             Paso_Solver_solveILU(prec->ilu,x,b);             Paso_Solver_solveILU(prec->ilu,x,b);
94             break;             break;
95            case PASO_RILU:
96               Paso_Solver_solveRILU(prec->rilu,x,b);
97               break;
98      }      }
99  }  }
   
 /*  
  * $Log$  
  * Revision 1.2  2005/09/15 03:44:40  jgs  
  * Merge of development branch dev-02 back to main trunk on 2005-09-15  
  *  
  * Revision 1.1.2.2  2005/09/07 00:59:09  gross  
  * some inconsistent renaming fixed to make the linking work.  
  *  
  * Revision 1.1.2.1  2005/09/05 06:29:50  gross  
  * These files have been extracted from finley to define a stand alone libray for iterative  
  * linear solvers on the ALTIX. main entry through Paso_solve. this version compiles but  
  * has not been tested yet.  
  *  
  *  
  */  

Legend:
Removed from v.425  
changed lines
  Added in v.1388

  ViewVC Help
Powered by ViewVC 1.1.26