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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 155 - (hide annotations)
Wed Nov 9 02:02:19 2005 UTC (13 years, 11 months ago) by jgs
Original Path: trunk/paso/src/Solvers/Solver.h
File MIME type: text/plain
File size: 2605 byte(s)
move all directories from trunk/esys2 into trunk and remove esys2

1 jgs 150 /* $Id$ */
2    
3     #ifndef INC_SOLVER
4     #define INC_SOLVER
5    
6     #include "SystemMatrix.h"
7    
8     #define FINLEY_SOLVER_TRACE
9     /* error codes used in the solver */
10     #define SOLVER_NO_ERROR 0
11     #define SOLVER_MAXITER_REACHED 1
12     #define SOLVER_INPUT_ERROR -1
13     #define SOLVER_MEMORY_ERROR -9
14     #define SOLVER_BREAKDOWN -10
15    
16 jgs 154 static double ONE=1.;
17     static double ZERO=0.;
18     static double TOLERANCE_FOR_SCALARS=0.;
19 jgs 150
20     /* ILU preconditioner */
21     struct Paso_Solver_ILU {
22     dim_t n;
23     dim_t n_block;
24     dim_t n_F;
25     dim_t n_C;
26     double* inv_A_FF;
27     index_t* A_FF_pivot;
28     Paso_SystemMatrix * A_FC;
29     Paso_SystemMatrix * A_CF;
30     index_t* rows_in_F;
31     index_t* rows_in_C;
32     index_t* mask_F;
33     index_t* mask_C;
34     double* x_F;
35     double* b_F;
36     double* x_C;
37     double* b_C;
38     struct Paso_Solver_ILU * ILU_of_Schur;
39     };
40     typedef struct Paso_Solver_ILU Paso_Solver_ILU;
41    
42    
43     /* jacobi preconditioner */
44    
45     typedef struct Paso_Solver_Jacobi {
46     dim_t n_block;
47     dim_t n;
48     double* values;
49     index_t* pivot;
50     } Paso_Solver_Jacobi;
51    
52     /* general preconditioner interface */
53    
54     typedef struct Paso_Solver_Preconditioner {
55     dim_t type;
56     /* jacobi preconditioner */
57     Paso_Solver_Jacobi* jacobi;
58     /* ilu preconditioner */
59     Paso_Solver_ILU* ilu;
60     } Paso_Solver_Preconditioner;
61    
62     void Paso_Solver(Paso_SystemMatrix*,double*,double*,Paso_Options*);
63     void Paso_Solver_free(Paso_SystemMatrix*);
64     err_t Paso_Solver_BiCGStab( Paso_SystemMatrix * A, double* B, double * X, dim_t *iter, double * tolerance);
65     err_t Paso_Solver_PCG( Paso_SystemMatrix * A, double* B, double * X, dim_t *iter, double * tolerance);
66     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);
67     void Paso_Preconditioner_free(Paso_Solver_Preconditioner*);
68     void Paso_Solver_setPreconditioner(Paso_SystemMatrix* A,Paso_Options* options);
69     void Paso_Solver_solvePreconditioner(Paso_SystemMatrix* A,double*,double*);
70     void Paso_Solver_applyBlockDiagonalMatrix(dim_t n_block,dim_t n,double* D,index_t* pivot,double* x,double* b);
71     void Paso_Solver_ILU_free(Paso_Solver_ILU * in);
72     Paso_Solver_ILU* Paso_Solver_getILU(Paso_SystemMatrix * A_p,bool_t verbose);
73     void Paso_Solver_solveILU(Paso_Solver_ILU * ilu, double * x, double * b);
74     void Paso_Solver_updateIncompleteSchurComplement(Paso_SystemMatrix* A_CC,Paso_SystemMatrix *A_CF,double* invA_FF,index_t* A_FF_pivot,Paso_SystemMatrix *A_FC);
75     Paso_Solver_Jacobi* Paso_Solver_getJacobi(Paso_SystemMatrix * A_p);
76     void Paso_Solver_solveJacobi(Paso_Solver_Jacobi * prec, double * x, double * b);
77     void Paso_Solver_Jacobi_free(Paso_Solver_Jacobi * in);
78    
79     #endif /* #ifndef INC_SOLVER */

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26