/[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 3140 by gross, Thu Sep 2 07:26:43 2010 UTC revision 3158 by gross, Mon Sep 6 06:09:11 2010 UTC
# Line 34  Line 34 
34    
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_Preconditioner_Jacobi_free(in->jacobi);        Paso_Preconditioner_Smoother_free(in->jacobi);
38        Paso_Preconditioner_GS_free(in->gs);        Paso_Preconditioner_Smoother_free(in->gs);
39        Paso_Solver_AMG_free(in->amg);        Paso_Solver_AMG_free(in->amg);
40                
41                
# Line 71  Paso_Solver_Preconditioner* Paso_Precond Line 71  Paso_Solver_Preconditioner* Paso_Precond
71          switch (options->preconditioner) {          switch (options->preconditioner) {
72             default:             default:
73             case PASO_JACOBI:             case PASO_JACOBI:
74                if (options->verbose) printf("Jacobi preconditioner is used.\n");            if (options->verbose) printf("Jacobi(%d) preconditioner is used.\n",options->sweeps);
75            prec->jacobi=Paso_Preconditioner_Jacobi_alloc(A);            prec->jacobi=Paso_Preconditioner_Smoother_alloc(A, TRUE, options->use_local_preconditioner, options->verbose);
76                prec->type=PASO_JACOBI;                prec->type=PASO_JACOBI;
77              prec->sweeps=options->sweeps;
78                break;                break;
79         case PASO_GS:         case PASO_GS:
80            if (options->sweeps > 0 ) {            if (options->verbose) printf("Gauss-Seidel(%d) preconditioner is used.\n",options->sweeps);
81            if (options->verbose) printf("Gauss-Seidel(%d) preconditioner is used.\n",options->sweeps);            prec->gs=Paso_Preconditioner_Smoother_alloc(A, FALSE, options->use_local_preconditioner, options->verbose);
82            prec->gs=Paso_Preconditioner_GS_alloc(A, options->sweeps, options->use_local_preconditioner, options->verbose);            prec->type=PASO_GS;
83            prec->type=PASO_GS;            prec->sweeps=options->sweeps;
           } else {  
          if (options->verbose) printf("Jacobi preconditioner is used.\n");  
          prec->jacobi=Paso_Preconditioner_Jacobi_alloc(A);  
          prec->type=PASO_JACOBI;  
           }  
84            break;            break;
85         /***************************************************************************************/           /***************************************************************************************/  
86             case PASO_ILU0:             case PASO_ILU0:
# Line 154  void Paso_Preconditioner_solve(Paso_Solv Line 150  void Paso_Preconditioner_solve(Paso_Solv
150      switch (prec->type) {      switch (prec->type) {
151          default:          default:
152          case PASO_JACOBI:          case PASO_JACOBI:
153             Paso_Preconditioner_Jacobi_solve(A, prec->jacobi,x,b);         Paso_Preconditioner_Smoother_solve(A, prec->jacobi,x,b,prec->sweeps);
154             break;               break;  
155      case PASO_GS:      case PASO_GS:
156         Paso_Preconditioner_GS_solve(A, prec->gs,x,b);         Paso_Preconditioner_Smoother_solve(A, prec->gs,x,b,prec->sweeps);
157         break;               break;      
158          case PASO_ILU0:          case PASO_ILU0:
159             Paso_Solver_solveILU(A->mainBlock, prec->ilu,x,b);             Paso_Solver_solveILU(A->mainBlock, prec->ilu,x,b);

Legend:
Removed from v.3140  
changed lines
  Added in v.3158

  ViewVC Help
Powered by ViewVC 1.1.26