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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 431 - (hide annotations)
Fri Jan 13 05:07:10 2006 UTC (13 years, 10 months ago) by gross
Original Path: trunk/paso/src/Solvers/Solver.h
File MIME type: text/plain
File size: 3125 byte(s)
new implementation of ILU0
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 gross 431 dim_t n_block;
23 jgs 150 dim_t n;
24 gross 431 index_t num_colors;
25     index_t* colorOf;
26     index_t* main_iptr;
27     double* factors;
28     Paso_SystemMatrixPattern* pattern;
29 jgs 150 };
30     typedef struct Paso_Solver_ILU Paso_Solver_ILU;
31    
32 gross 430 /* RILU preconditioner */
33     struct Paso_Solver_RILU {
34     dim_t n;
35     dim_t n_block;
36     dim_t n_F;
37     dim_t n_C;
38     double* inv_A_FF;
39     index_t* A_FF_pivot;
40     Paso_SystemMatrix * A_FC;
41     Paso_SystemMatrix * A_CF;
42     index_t* rows_in_F;
43     index_t* rows_in_C;
44     index_t* mask_F;
45     index_t* mask_C;
46     double* x_F;
47     double* b_F;
48     double* x_C;
49     double* b_C;
50     struct Paso_Solver_RILU * RILU_of_Schur;
51     };
52     typedef struct Paso_Solver_RILU Paso_Solver_RILU;
53 jgs 150
54 gross 430
55 jgs 150 /* jacobi preconditioner */
56    
57     typedef struct Paso_Solver_Jacobi {
58     dim_t n_block;
59     dim_t n;
60     double* values;
61     index_t* pivot;
62     } Paso_Solver_Jacobi;
63    
64     /* general preconditioner interface */
65    
66     typedef struct Paso_Solver_Preconditioner {
67     dim_t type;
68     /* jacobi preconditioner */
69     Paso_Solver_Jacobi* jacobi;
70     /* ilu preconditioner */
71     Paso_Solver_ILU* ilu;
72 gross 430 /* ilu preconditioner */
73     Paso_Solver_RILU* rilu;
74 jgs 150 } Paso_Solver_Preconditioner;
75    
76     void Paso_Solver(Paso_SystemMatrix*,double*,double*,Paso_Options*);
77     void Paso_Solver_free(Paso_SystemMatrix*);
78     err_t Paso_Solver_BiCGStab( Paso_SystemMatrix * A, double* B, double * X, dim_t *iter, double * tolerance);
79     err_t Paso_Solver_PCG( Paso_SystemMatrix * A, double* B, double * X, dim_t *iter, double * tolerance);
80     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);
81     void Paso_Preconditioner_free(Paso_Solver_Preconditioner*);
82     void Paso_Solver_setPreconditioner(Paso_SystemMatrix* A,Paso_Options* options);
83     void Paso_Solver_solvePreconditioner(Paso_SystemMatrix* A,double*,double*);
84     void Paso_Solver_applyBlockDiagonalMatrix(dim_t n_block,dim_t n,double* D,index_t* pivot,double* x,double* b);
85 gross 431
86 jgs 150 void Paso_Solver_ILU_free(Paso_Solver_ILU * in);
87     Paso_Solver_ILU* Paso_Solver_getILU(Paso_SystemMatrix * A_p,bool_t verbose);
88     void Paso_Solver_solveILU(Paso_Solver_ILU * ilu, double * x, double * b);
89 gross 431
90     void Paso_Solver_RILU_free(Paso_Solver_RILU * in);
91     Paso_Solver_RILU* Paso_Solver_getRILU(Paso_SystemMatrix * A_p,bool_t verbose);
92     void Paso_Solver_solveRILU(Paso_Solver_RILU * rilu, double * x, double * b);
93    
94     void Paso_Solver_updateIncompleteSchurComplement(Paso_SystemMatrix* A_CC,Paso_SystemMatrix *A_CF,double*
95     invA_FF,index_t* A_FF_pivot,Paso_SystemMatrix *A_FC);
96 jgs 150 Paso_Solver_Jacobi* Paso_Solver_getJacobi(Paso_SystemMatrix * A_p);
97     void Paso_Solver_solveJacobi(Paso_Solver_Jacobi * prec, double * x, double * b);
98     void Paso_Solver_Jacobi_free(Paso_Solver_Jacobi * in);
99    
100     #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