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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 584 - (show annotations)
Thu Mar 9 23:03:38 2006 UTC (13 years, 7 months ago) by gross
Original Path: trunk/paso/src/Solvers/Solver.h
File MIME type: text/plain
File size: 3234 byte(s)
eigenvalues: compiles and passes tests on altix now
1 /* $Id$ */
2
3 #ifndef INC_SOLVER
4 #define INC_SOLVER
5
6 #include "SystemMatrix.h"
7 #include "performance.h"
8
9 #define FINLEY_SOLVER_TRACE
10 /* error codes used in the solver */
11 #define SOLVER_NO_ERROR 0
12 #define SOLVER_MAXITER_REACHED 1
13 #define SOLVER_INPUT_ERROR -1
14 #define SOLVER_MEMORY_ERROR -9
15 #define SOLVER_BREAKDOWN -10
16
17 static double ONE=1.;
18 static double ZERO=0.;
19 static double TOLERANCE_FOR_SCALARS=0.;
20
21 /* ILU preconditioner */
22 struct Paso_Solver_ILU {
23 dim_t n_block;
24 dim_t n;
25 index_t num_colors;
26 index_t* colorOf;
27 index_t* main_iptr;
28 double* factors;
29 Paso_SystemMatrixPattern* pattern;
30 };
31 typedef struct Paso_Solver_ILU Paso_Solver_ILU;
32
33 /* RILU preconditioner */
34 struct Paso_Solver_RILU {
35 dim_t n;
36 dim_t n_block;
37 dim_t n_F;
38 dim_t n_C;
39 double* inv_A_FF;
40 index_t* A_FF_pivot;
41 Paso_SystemMatrix * A_FC;
42 Paso_SystemMatrix * A_CF;
43 index_t* rows_in_F;
44 index_t* rows_in_C;
45 index_t* mask_F;
46 index_t* mask_C;
47 double* x_F;
48 double* b_F;
49 double* x_C;
50 double* b_C;
51 struct Paso_Solver_RILU * RILU_of_Schur;
52 };
53 typedef struct Paso_Solver_RILU Paso_Solver_RILU;
54
55
56 /* jacobi preconditioner */
57
58 typedef struct Paso_Solver_Jacobi {
59 dim_t n_block;
60 dim_t n;
61 double* values;
62 index_t* pivot;
63 } Paso_Solver_Jacobi;
64
65 /* general preconditioner interface */
66
67 typedef struct Paso_Solver_Preconditioner {
68 dim_t type;
69 /* jacobi preconditioner */
70 Paso_Solver_Jacobi* jacobi;
71 /* ilu preconditioner */
72 Paso_Solver_ILU* ilu;
73 /* ilu preconditioner */
74 Paso_Solver_RILU* rilu;
75 } Paso_Solver_Preconditioner;
76
77 void Paso_Solver(Paso_SystemMatrix*,double*,double*,Paso_Options*,Paso_Performance* pp);
78 void Paso_Solver_free(Paso_SystemMatrix*);
79 err_t Paso_Solver_BiCGStab( Paso_SystemMatrix * A, double* B, double * X, dim_t *iter, double * tolerance,Paso_Performance* pp);
80 err_t Paso_Solver_PCG( Paso_SystemMatrix * A, double* B, double * X, dim_t *iter, double * tolerance,Paso_Performance* pp);
81 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);
82 void Paso_Preconditioner_free(Paso_Solver_Preconditioner*);
83 void Paso_Solver_setPreconditioner(Paso_SystemMatrix* A,Paso_Options* options);
84 void Paso_Solver_solvePreconditioner(Paso_SystemMatrix* A,double*,double*);
85 void Paso_Solver_applyBlockDiagonalMatrix(dim_t n_block,dim_t n,double* D,index_t* pivot,double* x,double* b);
86
87 void Paso_Solver_ILU_free(Paso_Solver_ILU * in);
88 Paso_Solver_ILU* Paso_Solver_getILU(Paso_SystemMatrix * A_p,bool_t verbose);
89 void Paso_Solver_solveILU(Paso_Solver_ILU * ilu, double * x, double * b);
90
91 void Paso_Solver_RILU_free(Paso_Solver_RILU * in);
92 Paso_Solver_RILU* Paso_Solver_getRILU(Paso_SystemMatrix * A_p,bool_t verbose);
93 void Paso_Solver_solveRILU(Paso_Solver_RILU * rilu, double * x, double * b);
94
95 void Paso_Solver_updateIncompleteSchurComplement(Paso_SystemMatrix* A_CC,Paso_SystemMatrix *A_CF,double*
96 invA_FF,index_t* A_FF_pivot,Paso_SystemMatrix *A_FC);
97 Paso_Solver_Jacobi* Paso_Solver_getJacobi(Paso_SystemMatrix * A_p);
98 void Paso_Solver_solveJacobi(Paso_Solver_Jacobi * prec, double * x, double * b);
99 void Paso_Solver_Jacobi_free(Paso_Solver_Jacobi * in);
100
101 #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