/[escript]/trunk/esys2/finley/src/finleyC/System.h
ViewVC logotype

Contents of /trunk/esys2/finley/src/finleyC/System.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 97 - (show annotations)
Tue Dec 14 05:39:33 2004 UTC (14 years, 11 months ago) by jgs
File MIME type: text/plain
File size: 4312 byte(s)
*** empty log message ***

1 /* $Id$ */
2
3 /**************************************************************/
4
5 /* Finley: SystemMatrix and SystemVector */
6
7 /**************************************************************/
8
9 /* Copyrights by ACcESS Australia 2003 */
10 /* Author: gross@access.edu.au */
11 /* Version: $Id$ */
12
13 /**************************************************************/
14
15 #ifndef INC_FINLEY_SYSTEM
16 #define INC_FINLEY_SYSTEM
17
18
19 #include "escript/Data/DataC.h"
20 #include "SystemPattern.h"
21
22 /**************************************************************/
23
24 /* this struct holds a stiffness matrix: */
25
26 /* TODO: implement macro for make file */
27 /* libraries for linear solvers*/
28 #define NO_LIB 0
29 #define SGI_SCSL 1
30
31 /* matrix type */
32 #define CSC 0
33 #define CSR 1
34 /* these formats are used in the SCSL context */
35 #define CSC_SYM 2
36 #define CSR_SYM 3
37 #define CSC_BLK1 4
38 #define CSR_BLK1 5
39 #define CSC_BLK1_SYM 6
40 #define CSR_BLK1_SYM 7
41
42 typedef int Finley_SystemMatrixType;
43
44 typedef struct Finley_SystemMatrix {
45 Finley_SystemMatrixType type;
46 int reference_counter;
47
48 maybelong logical_row_block_size;
49 maybelong logical_col_block_size;
50 maybelong logical_block_size;
51
52 maybelong row_block_size;
53 maybelong col_block_size;
54 maybelong block_size;
55
56 maybelong num_rows;
57 maybelong num_cols;
58
59 Finley_SystemMatrixPattern* pattern;
60
61 size_t len;
62 double *val;
63
64 void* direct; /* pointer to data needed by the direct solver */
65 void* iterative; /* pointer to data needed by the iterative solver */
66
67 } Finley_SystemMatrix;
68
69 /* solver options */
70
71
72 #include "escript/Data/UtilC.h"
73
74 typedef struct {
75 int method;
76 int symmetric;
77 double tolerance;
78
79 int verbose;
80 int reordering;
81 double final_residual;
82 int preconditioner;
83 int iter_max;
84 int iter;
85 double drop_tolerance;
86 double drop_storage;
87 int truncation;
88 int restart;
89
90
91 } Finley_SolverOptions;
92
93 /* interfaces: */
94
95 Finley_SystemMatrix* Finley_SystemMatrix_alloc(Finley_SystemMatrixType,Finley_SystemMatrixPattern*,int,int);
96 Finley_SystemMatrix* Finley_SystemMatrix_reference(Finley_SystemMatrix*);
97 void Finley_SystemMatrix_dealloc(Finley_SystemMatrix*);
98
99 void Finley_SystemMatrix_setValues(Finley_SystemMatrix*,double);
100 void Finley_SystemMatrix_copy(Finley_SystemMatrix*,double*);
101 void Finley_SystemMatrix_add(Finley_SystemMatrix*,int,maybelong*, int,int,maybelong*,int, double*);
102 void Finley_RawScaledSystemMatrixVector(double alpha, Finley_SystemMatrix* A, double* in, double beta, double* out);
103 void Finley_SystemMatrixVector(escriptDataC *,Finley_SystemMatrix *, escriptDataC *);
104 void Finley_ScaledSystemMatrixVector(double, Finley_SystemMatrix *, escriptDataC *,double,escriptDataC *);
105
106 void Finley_SystemMatrix_saveMM(Finley_SystemMatrix *, char *);
107 void Finley_SystemMatrix_solve(Finley_SystemMatrix* A,escriptDataC* out,escriptDataC* in,Finley_SolverOptions* options);
108 void Finley_SystemMatrix_solve_free(Finley_SystemMatrix* in);
109 void Finley_SystemMatrix_nullifyRowsAndCols(Finley_SystemMatrix* A, escriptDataC* mask_row, escriptDataC* mask_col, double main_diagonal_value);
110 void Finley_SystemMatrixNullify(Finley_SystemMatrix* A, double* mask_row, double* mask_col, double main_diagonal_value);
111 void Finley_SystemMatrix_setDefaults(Finley_SolverOptions*);
112 int Finley_SystemMatrix_getSystemMatrixTypeId(int, int);
113
114 #endif /* #ifndef INC_FINLEY_SYSTEM */
115
116 /*
117 * $Log$
118 * Revision 1.2 2004/12/14 05:39:30 jgs
119 * *** empty log message ***
120 *
121 * Revision 1.1.1.1.2.3 2004/12/07 10:12:05 gross
122 * GMRES added
123 *
124 * Revision 1.1.1.1.2.2 2004/11/24 01:37:15 gross
125 * some changes dealing with the integer overflow in memory allocation. Finley solves 4M unknowns now
126 *
127 * Revision 1.1.1.1.2.1 2004/11/12 06:58:18 gross
128 * a lot of changes to get the linearPDE class running: most important change is that there is no matrix format exposed to the user anymore. the format is chosen by the Domain according to the solver and symmetry
129 *
130 * Revision 1.1.1.1 2004/10/26 06:53:57 jgs
131 * initial import of project esys2
132 *
133 * Revision 1.3 2004/08/28 12:58:08 gross
134 * SimpleSolve is not running yet: problem with == of functionsspace
135 *
136 * Revision 1.2 2004/07/20 01:51:59 gross
137 * finley CPP is almost compiling now
138 *
139 * Revision 1.1 2004/07/02 04:21:13 gross
140 * Finley C code has been included
141 *
142 *
143 */

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26