/[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 100 - (show annotations)
Wed Dec 15 03:48:48 2004 UTC (15 years ago) by jgs
File MIME type: text/plain
File size: 4156 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 "Mesh.h"
20 #include "escript/Data/DataC.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 /* TODO: implement macro for make file */
31
32 /* TODO: review need for PTR_INDEX/PTR_OFFSET */
33 /* Typically INDEX_OFFSET and PTR_OFFSET are 1 if the matrix is
34 handed over to a library written in FORTRAN. */
35
36 #define INDEX_OFFSET 0
37 #define PTR_OFFSET 0
38 #define FINLEY_DEFAULT_MATRIX_TYPE CSR
39
40 /* matrix type */
41 #define CSC 0
42 #define CSR 1
43
44 typedef int Finley_SystemMatrixType;
45
46 typedef struct Finley_SystemMatrix {
47 Finley_SystemMatrixType type;
48 int reference_counter;
49 maybelong total_row_block_size;
50 maybelong total_col_block_size;
51
52 maybelong row_block_size;
53 maybelong col_block_size;
54
55 maybelong num_rows;
56 maybelong num_cols;
57 int symmetric;
58 maybelong* ptr;
59 maybelong* index;
60 maybelong lenOfVal;
61 double *val;
62
63 void* solve; /* pointer to data needed by the direct solver */
64 void* iterative; /* pointer to data needed by the iterative solver */
65
66 } Finley_SystemMatrix;
67
68 /* solver options */
69
70 #define NO_REORDERING 0
71 #define MINIMUM_FILL_IN 1
72 #define NESTED_DISSECTION 2
73
74 #define DEFAULT_METHOD 0
75 #define PCG 1
76 #define CR 2
77 #define CGS 3
78 #define BICGSTAB 4
79 #define SSOR 5
80 #define ILU0 6
81 #define ILUT 7
82 #define JACOBI 8
83
84 typedef struct {
85 int verbose;
86 int reordering;
87 double tolerance;
88 double final_residual;
89 int iterative_method;
90 int preconditioner;
91 int iter_max;
92 int iter;
93 double drop_tolerance;
94 double drop_storage;
95 int iterative;
96
97 } Finley_SolverOptions;
98
99 /* interfaces: */
100
101 Finley_SystemMatrix* Finley_SystemMatrix_alloc(Finley_Mesh*,Finley_SystemMatrixType,int,int,int,int,int);
102 int Finley_comparIndex(const void *,const void *);
103 void Finley_SystemMatrix_dealloc(Finley_SystemMatrix*);
104
105 void Finley_SystemMatrix_setValues(Finley_SystemMatrix*,double);
106 void Finley_SystemMatrix_copy(Finley_SystemMatrix*,double*);
107 void Finley_SystemMatrix_add(Finley_SystemMatrix*,int,maybelong*, int,int,maybelong*,int, double*);
108 void Finley_RawScaledSystemMatrixVector(double alpha, Finley_SystemMatrix* A, double* in, double beta, double* out);
109 void Finley_SystemMatrixVector(escriptDataC *,Finley_SystemMatrix *, escriptDataC *);
110 void Finley_ScaledSystemMatrixVector(double, Finley_SystemMatrix *, escriptDataC *,double,escriptDataC *);
111
112 void Finley_SystemMatrix_saveMM(Finley_SystemMatrix *, char *);
113 void Finley_SystemMatrix_solve(Finley_SystemMatrix* A,escriptDataC* out,escriptDataC* in,Finley_SolverOptions* options);
114 void Finley_SystemMatrix_solve_free(Finley_SystemMatrix* in);
115 void Finley_SystemMatrix_iterative(Finley_SystemMatrix* A,escriptDataC* out,escriptDataC* in,Finley_SolverOptions* options);
116 void Finley_SystemMatrix_iterative_free(Finley_SystemMatrix* in);
117 void Finley_SystemMatrix_nullifyRowsAndCols(Finley_SystemMatrix* A, escriptDataC* mask_row, escriptDataC* mask_col, double main_diagonal_value);
118 void Finley_SystemMatrixNullify(Finley_SystemMatrix* A, double* mask_row, double* mask_col, double main_diagonal_value);
119 void Finley_SystemMatrix_setDefaults(Finley_SolverOptions*);
120
121 #endif /* #ifndef INC_FINLEY_SYSTEM */
122
123 /*
124 * $Log$
125 * Revision 1.3 2004/12/15 03:48:46 jgs
126 * *** empty log message ***
127 *
128 * Revision 1.1.1.1 2004/10/26 06:53:57 jgs
129 * initial import of project esys2
130 *
131 * Revision 1.3 2004/08/28 12:58:08 gross
132 * SimpleSolve is not running yet: problem with == of functionsspace
133 *
134 * Revision 1.2 2004/07/20 01:51:59 gross
135 * finley CPP is almost compiling now
136 *
137 * Revision 1.1 2004/07/02 04:21:13 gross
138 * Finley C code has been included
139 *
140 *
141 */

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26