/[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

revision 1388 by trankine, Fri Jan 11 07:45:58 2008 UTC revision 1823 by artak, Wed Oct 1 05:56:05 2008 UTC
# Line 1  Line 1 
1    
 /* $Id$ */  
   
2  /*******************************************************  /*******************************************************
3   *  *
4   *           Copyright 2003-2007 by ACceSS MNRF  * Copyright (c) 2003-2008 by University of Queensland
5   *       Copyright 2007 by University of Queensland  * Earth Systems Science Computational Center (ESSCC)
6   *  * http://www.uq.edu.au/esscc
7   *                http://esscc.uq.edu.au  *
8   *        Primary Business: Queensland, Australia  * Primary Business: Queensland, Australia
9   *  Licensed under the Open Software License version 3.0  * Licensed under the Open Software License version 3.0
10   *     http://www.opensource.org/licenses/osl-3.0.php  * http://www.opensource.org/licenses/osl-3.0.php
11   *  *
12   *******************************************************/  *******************************************************/
13    
14    
15  /**************************************************************/  /**************************************************************/
16    
# Line 37  void Paso_Preconditioner_free(Paso_Solve Line 36  void Paso_Preconditioner_free(Paso_Solve
36        Paso_Solver_ILU_free(in->ilu);        Paso_Solver_ILU_free(in->ilu);
37        Paso_Solver_RILU_free(in->rilu);        Paso_Solver_RILU_free(in->rilu);
38        Paso_Solver_Jacobi_free(in->jacobi);        Paso_Solver_Jacobi_free(in->jacobi);
39          Paso_Solver_GS_free(in->gs);
40        MEMFREE(in);        MEMFREE(in);
41      }      }
42  }  }
# Line 52  void Paso_Solver_setPreconditioner(Paso_ Line 52  void Paso_Solver_setPreconditioner(Paso_
52          prec->rilu=NULL;          prec->rilu=NULL;
53          prec->ilu=NULL;          prec->ilu=NULL;
54          prec->jacobi=NULL;          prec->jacobi=NULL;
55            prec->gs=NULL;
56          A->solver=prec;          A->solver=prec;
57          switch (options->preconditioner) {          switch (options->preconditioner) {
58             default:             default:
# Line 70  void Paso_Solver_setPreconditioner(Paso_ Line 71  void Paso_Solver_setPreconditioner(Paso_
71                prec->rilu=Paso_Solver_getRILU(A->mainBlock,options->verbose);                prec->rilu=Paso_Solver_getRILU(A->mainBlock,options->verbose);
72                prec->type=PASO_RILU;                prec->type=PASO_RILU;
73                break;                break;
74                case PASO_GS:
75                  if (options->verbose) printf("Gauss-Seidel preconditioner is used.\n");
76                  prec->gs=Paso_Solver_getGS(A->mainBlock,options->verbose);
77                  prec->gs->sweeps=options->sweeps;
78                  prec->type=PASO_GS;
79                  break;
80          }          }
81          if (! Paso_MPIInfo_noError(A->mpi_info ) ){          if (! Paso_MPIInfo_noError(A->mpi_info ) ){
82             Paso_Preconditioner_free(prec);             Paso_Preconditioner_free(prec);
# Line 83  void Paso_Solver_setPreconditioner(Paso_ Line 90  void Paso_Solver_setPreconditioner(Paso_
90  /* barrier synchronization is performed before the evaluation to make sure that the input vector is available */  /* barrier synchronization is performed before the evaluation to make sure that the input vector is available */
91  void Paso_Solver_solvePreconditioner(Paso_SystemMatrix* A,double* x,double* b){  void Paso_Solver_solvePreconditioner(Paso_SystemMatrix* A,double* x,double* b){
92      Paso_Solver_Preconditioner* prec=(Paso_Solver_Preconditioner*) A->solver;      Paso_Solver_Preconditioner* prec=(Paso_Solver_Preconditioner*) A->solver;
     #pragma omp barrier  
93      switch (prec->type) {      switch (prec->type) {
94          default:          default:
95          case PASO_JACOBI:          case PASO_JACOBI:
# Line 95  void Paso_Solver_solvePreconditioner(Pas Line 101  void Paso_Solver_solvePreconditioner(Pas
101          case PASO_RILU:          case PASO_RILU:
102             Paso_Solver_solveRILU(prec->rilu,x,b);             Paso_Solver_solveRILU(prec->rilu,x,b);
103             break;             break;
104             case PASO_GS:
105               Paso_Solver_solveGS(prec->gs,x,b);
106               break;
107      }      }
108  }  }

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

  ViewVC Help
Powered by ViewVC 1.1.26