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

Contents of /trunk/paso/src/Solvers/Solver.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 430 - (show annotations)
Wed Jan 11 06:40:50 2006 UTC (14 years, 7 months ago) by gross
File MIME type: text/plain
File size: 3102 byte(s)
ILU has been replicated is called RILU (recursive ILU) now. ILU will now be reimplemented.
1 /* $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 static double ONE=1.;
17 static double ZERO=0.;
18 static double TOLERANCE_FOR_SCALARS=0.;
19
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 /* RILU preconditioner */
43 struct Paso_Solver_RILU {
44 dim_t n;
45 dim_t n_block;
46 dim_t n_F;
47 dim_t n_C;
48 double* inv_A_FF;
49 index_t* A_FF_pivot;
50 Paso_SystemMatrix * A_FC;
51 Paso_SystemMatrix * A_CF;
52 index_t* rows_in_F;
53 index_t* rows_in_C;
54 index_t* mask_F;
55 index_t* mask_C;
56 double* x_F;
57 double* b_F;
58 double* x_C;
59 double* b_C;
60 struct Paso_Solver_RILU * RILU_of_Schur;
61 };
62 typedef struct Paso_Solver_RILU Paso_Solver_RILU;
63
64
65 /* jacobi preconditioner */
66
67 typedef struct Paso_Solver_Jacobi {
68 dim_t n_block;
69 dim_t n;
70 double* values;
71 index_t* pivot;
72 } Paso_Solver_Jacobi;
73
74 /* general preconditioner interface */
75
76 typedef struct Paso_Solver_Preconditioner {
77 dim_t type;
78 /* jacobi preconditioner */
79 Paso_Solver_Jacobi* jacobi;
80 /* ilu preconditioner */
81 Paso_Solver_ILU* ilu;
82 /* ilu preconditioner */
83 Paso_Solver_RILU* rilu;
84 } Paso_Solver_Preconditioner;
85
86 void Paso_Solver(Paso_SystemMatrix*,double*,double*,Paso_Options*);
87 void Paso_Solver_free(Paso_SystemMatrix*);
88 err_t Paso_Solver_BiCGStab( Paso_SystemMatrix * A, double* B, double * X, dim_t *iter, double * tolerance);
89 err_t Paso_Solver_PCG( Paso_SystemMatrix * A, double* B, double * X, dim_t *iter, double * tolerance);
90 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);
91 void Paso_Preconditioner_free(Paso_Solver_Preconditioner*);
92 void Paso_Solver_setPreconditioner(Paso_SystemMatrix* A,Paso_Options* options);
93 void Paso_Solver_solvePreconditioner(Paso_SystemMatrix* A,double*,double*);
94 void Paso_Solver_applyBlockDiagonalMatrix(dim_t n_block,dim_t n,double* D,index_t* pivot,double* x,double* b);
95 void Paso_Solver_ILU_free(Paso_Solver_ILU * in);
96 Paso_Solver_ILU* Paso_Solver_getILU(Paso_SystemMatrix * A_p,bool_t verbose);
97 void Paso_Solver_solveILU(Paso_Solver_ILU * ilu, double * x, double * b);
98 void Paso_Solver_updateIncompleteSchurComplement(Paso_SystemMatrix* A_CC,Paso_SystemMatrix *A_CF,double* invA_FF,index_t* A_FF_pivot,Paso_SystemMatrix *A_FC);
99 Paso_Solver_Jacobi* Paso_Solver_getJacobi(Paso_SystemMatrix * A_p);
100 void Paso_Solver_solveJacobi(Paso_Solver_Jacobi * prec, double * x, double * b);
101 void Paso_Solver_Jacobi_free(Paso_Solver_Jacobi * in);
102
103 #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