/[escript]/trunk/paso/src/Solver.h
ViewVC logotype

Diff of /trunk/paso/src/Solver.h

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

trunk/paso/src/Solvers/Solver.h revision 155 by jgs, Wed Nov 9 02:02:19 2005 UTC trunk/paso/src/Solver.h revision 700 by gross, Thu Apr 6 00:13:40 2006 UTC
# Line 1  Line 1 
1  /* $Id$ */  /* $Id$ */
2    
3    /*
4    ********************************************************************************
5    *               Copyright   2006 by ACcESS MNRF                                *
6    *                                                                              *
7    *                 http://www.access.edu.au                                     *
8    *           Primary Business: Queensland, Australia                            *
9    *     Licensed under the Open Software License version 3.0             *
10    *        http://www.opensource.org/licenses/osl-3.0.php                        *
11    ********************************************************************************
12    */
13    
14  #ifndef INC_SOLVER  #ifndef INC_SOLVER
15  #define INC_SOLVER  #define INC_SOLVER
16    
17  #include "SystemMatrix.h"  #include "SystemMatrix.h"
18    #include "performance.h"
19    
20  #define FINLEY_SOLVER_TRACE  #define FINLEY_SOLVER_TRACE
21  /* error codes used in the solver */  /* error codes used in the solver */
# Line 19  static double TOLERANCE_FOR_SCALARS=0.; Line 31  static double TOLERANCE_FOR_SCALARS=0.;
31    
32  /* ILU preconditioner */  /* ILU preconditioner */
33  struct Paso_Solver_ILU {  struct Paso_Solver_ILU {
34      dim_t n_block;
35      dim_t n;
36      index_t num_colors;
37      index_t* colorOf;
38      index_t* main_iptr;
39      double* factors;
40      Paso_SystemMatrixPattern* pattern;
41    };
42    typedef struct Paso_Solver_ILU Paso_Solver_ILU;
43    
44    /* RILU preconditioner */
45    struct Paso_Solver_RILU {
46    dim_t n;    dim_t n;
47    dim_t n_block;    dim_t n_block;
48    dim_t n_F;    dim_t n_F;
# Line 35  struct Paso_Solver_ILU { Line 59  struct Paso_Solver_ILU {
59    double* b_F;    double* b_F;
60    double* x_C;    double* x_C;
61    double* b_C;    double* b_C;
62    struct Paso_Solver_ILU * ILU_of_Schur;    struct Paso_Solver_RILU * RILU_of_Schur;
63  };  };
64  typedef struct Paso_Solver_ILU Paso_Solver_ILU;  typedef struct Paso_Solver_RILU Paso_Solver_RILU;
65    
66    
67  /* jacobi  preconditioner */  /* jacobi  preconditioner */
# Line 57  typedef struct Paso_Solver_Preconditione Line 81  typedef struct Paso_Solver_Preconditione
81    Paso_Solver_Jacobi* jacobi;    Paso_Solver_Jacobi* jacobi;
82    /* ilu preconditioner */    /* ilu preconditioner */
83    Paso_Solver_ILU* ilu;    Paso_Solver_ILU* ilu;
84      /* ilu preconditioner */
85      Paso_Solver_RILU* rilu;
86  } Paso_Solver_Preconditioner;  } Paso_Solver_Preconditioner;
87    
88  void Paso_Solver(Paso_SystemMatrix*,double*,double*,Paso_Options*);  void Paso_Solver(Paso_SystemMatrix*,double*,double*,Paso_Options*,Paso_Performance* pp);
89  void Paso_Solver_free(Paso_SystemMatrix*);  void Paso_Solver_free(Paso_SystemMatrix*);
90  err_t Paso_Solver_BiCGStab( Paso_SystemMatrix * A, double* B, double * X, dim_t *iter, double * tolerance);  err_t Paso_Solver_BiCGStab( Paso_SystemMatrix * A, double* B, double * X, dim_t *iter, double * tolerance,Paso_Performance* pp);
91  err_t Paso_Solver_PCG( Paso_SystemMatrix * A, double* B, double * X, dim_t *iter, double * tolerance);  err_t Paso_Solver_PCG( Paso_SystemMatrix * A, double* B, double * X, dim_t *iter, double * tolerance,Paso_Performance* pp);
92  err_t Paso_Solver_GMRES(Paso_SystemMatrix * A, double * r, double * x, dim_t *num_iter, double * tolerance,dim_t length_of_recursion,dim_t restart);  err_t Paso_Solver_GMRES(Paso_SystemMatrix * A, double * r, double * x, dim_t *num_iter, double * tolerance,dim_t length_of_recursion,dim_t restart,Paso_Performance* pp);
93  void Paso_Preconditioner_free(Paso_Solver_Preconditioner*);  void Paso_Preconditioner_free(Paso_Solver_Preconditioner*);
94  void Paso_Solver_setPreconditioner(Paso_SystemMatrix* A,Paso_Options* options);  void Paso_Solver_setPreconditioner(Paso_SystemMatrix* A,Paso_Options* options);
95  void Paso_Solver_solvePreconditioner(Paso_SystemMatrix* A,double*,double*);  void Paso_Solver_solvePreconditioner(Paso_SystemMatrix* A,double*,double*);
96  void Paso_Solver_applyBlockDiagonalMatrix(dim_t n_block,dim_t n,double* D,index_t* pivot,double* x,double* b);  void Paso_Solver_applyBlockDiagonalMatrix(dim_t n_block,dim_t n,double* D,index_t* pivot,double* x,double* b);
97    
98  void Paso_Solver_ILU_free(Paso_Solver_ILU * in);  void Paso_Solver_ILU_free(Paso_Solver_ILU * in);
99  Paso_Solver_ILU* Paso_Solver_getILU(Paso_SystemMatrix * A_p,bool_t verbose);  Paso_Solver_ILU* Paso_Solver_getILU(Paso_SystemMatrix * A_p,bool_t verbose);
100  void Paso_Solver_solveILU(Paso_Solver_ILU * ilu, double * x, double * b);  void Paso_Solver_solveILU(Paso_Solver_ILU * ilu, double * x, double * b);
101  void Paso_Solver_updateIncompleteSchurComplement(Paso_SystemMatrix* A_CC,Paso_SystemMatrix *A_CF,double* invA_FF,index_t* A_FF_pivot,Paso_SystemMatrix *A_FC);  
102    void Paso_Solver_RILU_free(Paso_Solver_RILU * in);
103    Paso_Solver_RILU* Paso_Solver_getRILU(Paso_SystemMatrix * A_p,bool_t verbose);
104    void Paso_Solver_solveRILU(Paso_Solver_RILU * rilu, double * x, double * b);
105    
106    void Paso_Solver_updateIncompleteSchurComplement(Paso_SystemMatrix* A_CC,Paso_SystemMatrix *A_CF,double*
107    invA_FF,index_t* A_FF_pivot,Paso_SystemMatrix *A_FC);
108  Paso_Solver_Jacobi* Paso_Solver_getJacobi(Paso_SystemMatrix * A_p);  Paso_Solver_Jacobi* Paso_Solver_getJacobi(Paso_SystemMatrix * A_p);
109  void Paso_Solver_solveJacobi(Paso_Solver_Jacobi * prec, double * x, double * b);  void Paso_Solver_solveJacobi(Paso_Solver_Jacobi * prec, double * x, double * b);
110  void Paso_Solver_Jacobi_free(Paso_Solver_Jacobi * in);  void Paso_Solver_Jacobi_free(Paso_Solver_Jacobi * in);

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

  ViewVC Help
Powered by ViewVC 1.1.26