/[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 155 by jgs, Wed Nov 9 02:02:19 2005 UTC revision 425 by gross, Tue Jan 10 04:10:39 2006 UTC
# Line 30  void Paso_Preconditioner_free(Paso_Solve Line 30  void Paso_Preconditioner_free(Paso_Solve
30    
31  void Paso_Solver_setPreconditioner(Paso_SystemMatrix* A,Paso_Options* options) {  void Paso_Solver_setPreconditioner(Paso_SystemMatrix* A,Paso_Options* options) {
32      Paso_Solver_Preconditioner* prec=NULL;      Paso_Solver_Preconditioner* prec=NULL;
33      if (A->iterative==NULL) {      if (A->solver==NULL) {
34          /* allocate structure to hold preconditioner */          /* allocate structure to hold preconditioner */
35          prec=MEMALLOC(1,Paso_Solver_Preconditioner);          prec=MEMALLOC(1,Paso_Solver_Preconditioner);
36          if (Paso_checkPtr(prec)) return;          if (Paso_checkPtr(prec)) return;
37          prec->type=UNKNOWN;          prec->type=UNKNOWN;
38          prec->ilu=NULL;          prec->ilu=NULL;
39          prec->jacobi=NULL;          prec->jacobi=NULL;
40          A->iterative=prec;          A->solver=prec;
41          switch (options->preconditioner) {          switch (options->preconditioner) {
42             default:             default:
43             case PASO_JACOBI:             case PASO_JACOBI:
# Line 53  void Paso_Solver_setPreconditioner(Paso_ Line 53  void Paso_Solver_setPreconditioner(Paso_
53          }          }
54          if (! Paso_noError()) {          if (! Paso_noError()) {
55             Paso_Preconditioner_free(prec);             Paso_Preconditioner_free(prec);
56             A->iterative=NULL;             A->solver=NULL;
57          }          }
58      }      }
59  }  }
# Line 62  void Paso_Solver_setPreconditioner(Paso_ Line 62  void Paso_Solver_setPreconditioner(Paso_
62  /* has to be called within a parallel reqion */  /* has to be called within a parallel reqion */
63  /* 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 */
64  void Paso_Solver_solvePreconditioner(Paso_SystemMatrix* A,double* x,double* b){  void Paso_Solver_solvePreconditioner(Paso_SystemMatrix* A,double* x,double* b){
65      Paso_Solver_Preconditioner* prec=(Paso_Solver_Preconditioner*) A->iterative;      Paso_Solver_Preconditioner* prec=(Paso_Solver_Preconditioner*) A->solver;
66      #pragma omp barrier      #pragma omp barrier
67      switch (prec->type) {      switch (prec->type) {
68          default:          default:

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

  ViewVC Help
Powered by ViewVC 1.1.26