/[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 430 by gross, Wed Jan 11 06:40:50 2006 UTC trunk/paso/src/Solver.h revision 1804 by gross, Wed Sep 24 07:52:19 2008 UTC
# Line 1  Line 1 
1    
2  /* $Id$ */  /* $Id$ */
3    
4    /*******************************************************
5     *
6     *           Copyright 2003-2007 by ACceSS MNRF
7     *       Copyright 2007 by University of Queensland
8     *
9     *                http://esscc.uq.edu.au
10     *        Primary Business: Queensland, Australia
11     *  Licensed under the Open Software License version 3.0
12     *     http://www.opensource.org/licenses/osl-3.0.php
13     *
14     *******************************************************/
15    
16  #ifndef INC_SOLVER  #ifndef INC_SOLVER
17  #define INC_SOLVER  #define INC_SOLVER
18    
19  #include "SystemMatrix.h"  #include "SystemMatrix.h"
20    #include "performance.h"
21    #include "Functions.h"
22    
23  #define FINLEY_SOLVER_TRACE  #define PASO_TRACE
24  /* error codes used in the solver */  /* error codes used in the solver */
25  #define SOLVER_NO_ERROR 0  #define SOLVER_NO_ERROR 0
26  #define SOLVER_MAXITER_REACHED 1  #define SOLVER_MAXITER_REACHED 1
27  #define SOLVER_INPUT_ERROR -1  #define SOLVER_INPUT_ERROR -1
28  #define SOLVER_MEMORY_ERROR -9  #define SOLVER_MEMORY_ERROR -9
29  #define SOLVER_BREAKDOWN -10  #define SOLVER_BREAKDOWN -10
30    #define SOLVER_NEGATIVE_NORM_ERROR -11
31    
32    
33  static double ONE=1.;  static double ONE=1.;
34  static double ZERO=0.;  static double ZERO=0.;
# Line 19  static double TOLERANCE_FOR_SCALARS=0.; Line 36  static double TOLERANCE_FOR_SCALARS=0.;
36    
37  /* ILU preconditioner */  /* ILU preconditioner */
38  struct Paso_Solver_ILU {  struct Paso_Solver_ILU {
   dim_t n;  
39    dim_t n_block;    dim_t n_block;
40    dim_t n_F;    dim_t n;
41    dim_t n_C;    index_t num_colors;
42    double* inv_A_FF;    index_t* colorOf;
43    index_t* A_FF_pivot;    index_t* main_iptr;
44    Paso_SystemMatrix * A_FC;    double* factors;
45    Paso_SystemMatrix * A_CF;    Paso_Pattern* pattern;
   index_t* rows_in_F;  
   index_t* rows_in_C;  
   index_t* mask_F;  
   index_t* mask_C;  
   double* x_F;  
   double* b_F;  
   double* x_C;  
   double* b_C;  
   struct Paso_Solver_ILU * ILU_of_Schur;  
46  };  };
47  typedef struct Paso_Solver_ILU Paso_Solver_ILU;  typedef struct Paso_Solver_ILU Paso_Solver_ILU;
48    
# Line 47  struct Paso_Solver_RILU { Line 54  struct Paso_Solver_RILU {
54    dim_t n_C;    dim_t n_C;
55    double* inv_A_FF;    double* inv_A_FF;
56    index_t* A_FF_pivot;    index_t* A_FF_pivot;
57    Paso_SystemMatrix * A_FC;    Paso_SparseMatrix * A_FC;
58    Paso_SystemMatrix * A_CF;    Paso_SparseMatrix * A_CF;
59    index_t* rows_in_F;    index_t* rows_in_F;
60    index_t* rows_in_C;    index_t* rows_in_C;
61    index_t* mask_F;    index_t* mask_F;
# Line 83  typedef struct Paso_Solver_Preconditione Line 90  typedef struct Paso_Solver_Preconditione
90    Paso_Solver_RILU* rilu;    Paso_Solver_RILU* rilu;
91  } Paso_Solver_Preconditioner;  } Paso_Solver_Preconditioner;
92    
93  void Paso_Solver(Paso_SystemMatrix*,double*,double*,Paso_Options*);  void Paso_Solver(Paso_SystemMatrix*,double*,double*,Paso_Options*,Paso_Performance* pp);
94  void Paso_Solver_free(Paso_SystemMatrix*);  void Paso_Solver_free(Paso_SystemMatrix*);
95  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);
96  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);
97  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_TFQMR( Paso_SystemMatrix * A, double* B, double * X, dim_t *iter, double * tolerance, Paso_Performance* pp);
98    err_t Paso_Solver_MINRES( Paso_SystemMatrix * A, double* B, double * X, dim_t *iter, double * tolerance, double *tol, Paso_Performance* pp);
99    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);
100  void Paso_Preconditioner_free(Paso_Solver_Preconditioner*);  void Paso_Preconditioner_free(Paso_Solver_Preconditioner*);
101  void Paso_Solver_setPreconditioner(Paso_SystemMatrix* A,Paso_Options* options);  void Paso_Solver_setPreconditioner(Paso_SystemMatrix* A,Paso_Options* options);
102  void Paso_Solver_solvePreconditioner(Paso_SystemMatrix* A,double*,double*);  void Paso_Solver_solvePreconditioner(Paso_SystemMatrix* A,double*,double*);
103  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);
104    
105  void Paso_Solver_ILU_free(Paso_Solver_ILU * in);  void Paso_Solver_ILU_free(Paso_Solver_ILU * in);
106  Paso_Solver_ILU* Paso_Solver_getILU(Paso_SystemMatrix * A_p,bool_t verbose);  Paso_Solver_ILU* Paso_Solver_getILU(Paso_SparseMatrix * A_p,bool_t verbose);
107  void Paso_Solver_solveILU(Paso_Solver_ILU * ilu, double * x, double * b);  void Paso_Solver_solveILU(Paso_Solver_ILU * ilu, double * x, double * b);
108  void Paso_Solver_updateIncompleteSchurComplement(Paso_SystemMatrix* A_CC,Paso_SystemMatrix *A_CF,double* invA_FF,index_t* A_FF_pivot,Paso_SystemMatrix *A_FC);  
109  Paso_Solver_Jacobi* Paso_Solver_getJacobi(Paso_SystemMatrix * A_p);  void Paso_Solver_RILU_free(Paso_Solver_RILU * in);
110    Paso_Solver_RILU* Paso_Solver_getRILU(Paso_SparseMatrix * A_p,bool_t verbose);
111    void Paso_Solver_solveRILU(Paso_Solver_RILU * rilu, double * x, double * b);
112    
113    void Paso_Solver_updateIncompleteSchurComplement(Paso_SparseMatrix* A_CC, Paso_SparseMatrix *A_CF,double* invA_FF,index_t* A_FF_pivot, Paso_SparseMatrix *A_FC);
114    Paso_Solver_Jacobi* Paso_Solver_getJacobi(Paso_SparseMatrix * A_p);
115  void Paso_Solver_solveJacobi(Paso_Solver_Jacobi * prec, double * x, double * b);  void Paso_Solver_solveJacobi(Paso_Solver_Jacobi * prec, double * x, double * b);
116  void Paso_Solver_Jacobi_free(Paso_Solver_Jacobi * in);  void Paso_Solver_Jacobi_free(Paso_Solver_Jacobi * in);
117    
118    err_t Paso_Solver_GMRES2(Paso_Function * F, const double* f0, const double* x0, double * x, dim_t *iter, double* tolerance, Paso_Performance* pp);
119    err_t Paso_Solver_NewtonGMRES(Paso_Function *F, double *x, Paso_Options* options, Paso_Performance* pp);
120    
121    Paso_Function * Paso_Function_LinearSystem_alloc(Paso_SystemMatrix* A, double* b, Paso_Options* options);
122    err_t Paso_Function_LinearSystem_call(Paso_Function * F,double* value, const double* arg, Paso_Performance *pp);
123    void Paso_Function_LinearSystem_free(Paso_Function * F);
124    err_t Paso_Function_LinearSystem_setInitialGuess(Paso_SystemMatrix* A, double* x, Paso_Performance *pp);
125    
126  #endif /* #ifndef INC_SOLVER */  #endif /* #ifndef INC_SOLVER */

Legend:
Removed from v.430  
changed lines
  Added in v.1804

  ViewVC Help
Powered by ViewVC 1.1.26