1 |
jgs |
150 |
/* $Id$ */ |
2 |
|
|
|
3 |
|
|
/**************************************************************/ |
4 |
|
|
|
5 |
|
|
/* Paso: SystemMatrix and SystemVector */ |
6 |
|
|
|
7 |
|
|
/**************************************************************/ |
8 |
|
|
|
9 |
gross |
412 |
/* Copyrights by ACcESS Australia 2003,2004,2005,2006 */ |
10 |
jgs |
150 |
/* Author: gross@access.edu.au */ |
11 |
|
|
|
12 |
|
|
/**************************************************************/ |
13 |
|
|
|
14 |
|
|
#ifndef INC_PASO_SYSTEM |
15 |
|
|
#define INC_PASO_SYSTEM |
16 |
|
|
|
17 |
|
|
#include "Common.h" |
18 |
|
|
#include "SystemMatrixPattern.h" |
19 |
|
|
#include "Options.h" |
20 |
|
|
|
21 |
|
|
/**************************************************************/ |
22 |
|
|
|
23 |
|
|
/* this struct holds a stiffness matrix: */ |
24 |
|
|
|
25 |
gross |
412 |
#define FORMAT_CSR 1 |
26 |
|
|
#define FORMAT_SYM 2 |
27 |
|
|
#define FORMAT_BLK1 4 |
28 |
|
|
#define FORMAT_INDEX1 8 |
29 |
|
|
|
30 |
jgs |
150 |
/* matrix type */ |
31 |
|
|
#define CSC 0 |
32 |
gross |
412 |
#define CSR FORMAT_CSR |
33 |
jgs |
150 |
/* these formats are used in the SCSL context */ |
34 |
gross |
412 |
#define CSC_SYM FORMAT_SYM |
35 |
|
|
#define CSR_SYM (FORMAT_CSR+FORMAT_SYM) |
36 |
|
|
#define CSC_BLK1 FORMAT_BLK1 |
37 |
|
|
#define CSR_BLK1 (FORMAT_CSR+FORMAT_BLK1) |
38 |
|
|
#define CSC_BLK1_SYM (FORMAT_BLK1+FORMAT_SYM) |
39 |
|
|
#define CSR_BLK1_SYM (FORMAT_CSR+FORMAT_BLK1+FORMAT_SYM) |
40 |
jgs |
150 |
|
41 |
|
|
typedef int Paso_SystemMatrixType; |
42 |
|
|
|
43 |
|
|
typedef struct Paso_SystemMatrix { |
44 |
|
|
Paso_SystemMatrixType type; |
45 |
|
|
dim_t reference_counter; |
46 |
|
|
|
47 |
|
|
dim_t logical_row_block_size; |
48 |
|
|
dim_t logical_col_block_size; |
49 |
|
|
dim_t logical_block_size; |
50 |
|
|
|
51 |
|
|
dim_t row_block_size; |
52 |
|
|
dim_t col_block_size; |
53 |
|
|
dim_t block_size; |
54 |
|
|
|
55 |
|
|
dim_t num_rows; |
56 |
|
|
dim_t num_cols; |
57 |
|
|
|
58 |
|
|
Paso_SystemMatrixPattern* pattern; |
59 |
|
|
|
60 |
|
|
dim_t len; |
61 |
|
|
double *val; |
62 |
|
|
|
63 |
|
|
double *normalizer; /* vector with a inverse of the absolute row/col sum (set by Solver.c)*/ |
64 |
|
|
bool_t normalizer_is_valid; |
65 |
|
|
void* direct; /* pointer to data needed by the direct solver */ |
66 |
|
|
void* iterative; /* pointer to data needed by the iterative solver */ |
67 |
|
|
|
68 |
|
|
} Paso_SystemMatrix; |
69 |
|
|
|
70 |
|
|
/* interfaces: */ |
71 |
|
|
|
72 |
|
|
Paso_SystemMatrix* Paso_SystemMatrix_alloc(Paso_SystemMatrixType,Paso_SystemMatrixPattern*,dim_t,dim_t); |
73 |
|
|
Paso_SystemMatrix* Paso_SystemMatrix_reference(Paso_SystemMatrix*); |
74 |
|
|
void Paso_SystemMatrix_dealloc(Paso_SystemMatrix*); |
75 |
|
|
|
76 |
|
|
void Paso_SystemMatrix_setValues(Paso_SystemMatrix*,double); |
77 |
|
|
void Paso_SystemMatrix_copy(Paso_SystemMatrix*,double*); |
78 |
|
|
void Paso_SystemMatrix_add(Paso_SystemMatrix*,dim_t,index_t*, dim_t,dim_t,index_t*,dim_t, double*); |
79 |
|
|
void Paso_SystemMatrix_MatrixVector(double alpha, Paso_SystemMatrix* A, double* in, double beta, double* out); |
80 |
|
|
|
81 |
|
|
void Paso_SystemMatrix_saveMM(Paso_SystemMatrix *, char *); |
82 |
|
|
void Paso_SystemMatrix_saveHB(Paso_SystemMatrix *, char *); |
83 |
|
|
Paso_SystemMatrix* Paso_SystemMatrix_loadMM_toCSR(char *); |
84 |
|
|
void Paso_SystemMatrix_nullifyRowsAndCols(Paso_SystemMatrix* A, double* mask_row, double* mask_col, double main_diagonal_value); |
85 |
|
|
void Paso_SystemMatrix_setDefaults(Paso_Options*); |
86 |
|
|
int Paso_SystemMatrix_getSystemMatrixTypeId(index_t solver, index_t package, bool_t symmetry); |
87 |
|
|
Paso_SystemMatrix* Paso_SystemMatrix_getSubmatrix(Paso_SystemMatrix* A,dim_t,index_t*,index_t*); |
88 |
|
|
double* Paso_SystemMatrix_borrowNormalization(Paso_SystemMatrix* A); |
89 |
|
|
|
90 |
|
|
#endif /* #ifndef INC_PASO_SYSTEM */ |
91 |
|
|
|
92 |
|
|
/* |
93 |
|
|
* $Log$ |
94 |
|
|
* Revision 1.2 2005/09/15 03:44:38 jgs |
95 |
|
|
* Merge of development branch dev-02 back to main trunk on 2005-09-15 |
96 |
|
|
* |
97 |
|
|
* Revision 1.1.2.2 2005/09/07 00:59:08 gross |
98 |
|
|
* some inconsistent renaming fixed to make the linking work. |
99 |
|
|
* |
100 |
|
|
* Revision 1.1.2.1 2005/09/05 06:29:47 gross |
101 |
|
|
* These files have been extracted from finley to define a stand alone libray for iterative |
102 |
|
|
* linear solvers on the ALTIX. main entry through Paso_solve. this version compiles but |
103 |
|
|
* has not been tested yet. |
104 |
|
|
* |
105 |
|
|
* |
106 |
|
|
*/ |