/[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 113 - (show annotations)
Mon Feb 28 07:06:33 2005 UTC (14 years, 1 month ago) by jgs
File MIME type: text/plain
File size: 3461 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 Finley_SystemMatrix* Finley_SystemMatrix_getSubmatrix(Finley_SystemMatrix* A,int,maybelong*,maybelong*);
114
115 #endif /* #ifndef INC_FINLEY_SYSTEM */

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26