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

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

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

revision 3017 by artak, Thu Apr 29 03:40:12 2010 UTC revision 3051 by lgao, Tue Jun 29 00:45:49 2010 UTC
# Line 26  Line 26 
26  #include "Paso.h"  #include "Paso.h"
27  #include "SystemMatrix.h"  #include "SystemMatrix.h"
28  #include "Solver.h"  #include "Solver.h"
29    #include "PasoUtil.h"
30    
31  /***********************************************************************************/  /***********************************************************************************/
32    
# Line 36  void Paso_Preconditioner_free(Paso_Solve Line 37  void Paso_Preconditioner_free(Paso_Solve
37        Paso_Solver_ILU_free(in->ilu);        Paso_Solver_ILU_free(in->ilu);
38        Paso_Solver_RILU_free(in->rilu);        Paso_Solver_RILU_free(in->rilu);
39        Paso_Solver_Jacobi_free(in->jacobi);        Paso_Solver_Jacobi_free(in->jacobi);
40        Paso_Solver_GS_free(in->gs);        if (in->type==PASO_GAUSS_SEIDEL_MPI)
41            Paso_Solver_GSMPI_free(in->gs);
42          else
43            Paso_Solver_GS_free(in->gs);
44        Paso_Solver_AMG_free(in->amg);        Paso_Solver_AMG_free(in->amg);
45        Paso_Solver_AMG_System_free(in->amgSystem);        Paso_Solver_AMG_System_free(in->amgSystem);
46        Paso_Solver_AMLI_free(in->amli);        Paso_Solver_AMLI_free(in->amli);
# Line 93  void Paso_Solver_setPreconditioner(Paso_ Line 97  void Paso_Solver_setPreconditioner(Paso_
97                prec->gs->sweeps=options->sweeps;                prec->gs->sweeps=options->sweeps;
98                prec->type=PASO_GS;                prec->type=PASO_GS;
99                break;                break;
100                case PASO_GAUSS_SEIDEL_MPI:
101                  if (options->verbose) printf("MPI versioned Gauss-Seidel preconditioner is used.\n");
102                  prec->gs=Paso_Solver_getGSMPI(A->mainBlock,options->verbose);
103                  prec->gs->sweeps=options->sweeps;
104                  prec->type=PASO_GAUSS_SEIDEL_MPI;
105                  break;
106              case PASO_AMG:              case PASO_AMG:
107                if (options->verbose) printf("AMG preconditioner is used.\n");                if (options->verbose) printf("AMG preconditioner is used.\n");
108                prec->amg=Paso_Solver_getAMG(A->mainBlock,options->level_max,options);                  prec->amg=Paso_Solver_getAMG(A->mainBlock,options->level_max,options);  
# Line 222  void Paso_Solver_solvePreconditioner(Pas Line 232  void Paso_Solver_solvePreconditioner(Pas
232                  MEMFREE(bnew);                  MEMFREE(bnew);
233             }             }
234             break;             break;
235            case PASO_GAUSS_SEIDEL_MPI:
236               Paso_Solver_solveGSMPI(A,prec->gs,x,b);
237               break;
238          case PASO_AMG:          case PASO_AMG:
239              Paso_Solver_solveAMG(prec->amg,x,b);              Paso_Solver_solveAMG(prec->amg,x,b);
240    

Legend:
Removed from v.3017  
changed lines
  Added in v.3051

  ViewVC Help
Powered by ViewVC 1.1.26