/[escript]/branches/arrexp_2137_win/paso/src/SystemMatrix.h
ViewVC logotype

Contents of /branches/arrexp_2137_win/paso/src/SystemMatrix.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2202 - (show annotations)
Fri Jan 9 01:28:32 2009 UTC (10 years, 4 months ago) by jfenwick
File MIME type: text/plain
File size: 5394 byte(s)
Branching the array experiments from version 2137.
The idea is to make the changes required for the c++ changes to compile 
on windows without bringing in the later python changes.


1
2 /*******************************************************
3 *
4 * Copyright (c) 2003-2008 by University of Queensland
5 * Earth Systems Science Computational Center (ESSCC)
6 * http://www.uq.edu.au/esscc
7 *
8 * Primary Business: Queensland, Australia
9 * Licensed under the Open Software License version 3.0
10 * http://www.opensource.org/licenses/osl-3.0.php
11 *
12 *******************************************************/
13
14
15 /**************************************************************/
16
17 /* Paso: SystemMatrix and SystemVector */
18
19 /**************************************************************/
20
21 /* Copyrights by ACcESS Australia 2003,2004,2005,2006 */
22 /* Author: gross@access.edu.au */
23
24 /**************************************************************/
25
26 #ifndef INC_PASO_SYSTEMMATRIX
27 #define INC_PASO_SYSTEMMATRIX
28
29 #include "Common.h"
30 #include "SparseMatrix.h"
31 #include "SystemMatrixPattern.h"
32 #include "Options.h"
33 #include "Paso_MPI.h"
34 #include "Paso.h"
35 #include "Coupler.h"
36
37
38 /**************************************************************/
39
40 /* this struct holds a stiffness matrix: */
41
42 #define MATRIX_FORMAT_DEFAULT 0
43 #define MATRIX_FORMAT_CSC 1
44 #define MATRIX_FORMAT_SYM 2
45 #define MATRIX_FORMAT_BLK1 4
46 #define MATRIX_FORMAT_OFFSET1 8
47 #define MATRIX_FORMAT_TRILINOS_CRS 16
48
49 typedef int Paso_SystemMatrixType;
50
51 typedef struct Paso_SystemMatrix {
52 Paso_SystemMatrixType type;
53 Paso_SystemMatrixPattern *pattern;
54
55 dim_t reference_counter;
56
57 dim_t logical_row_block_size;
58 dim_t logical_col_block_size;
59 dim_t logical_block_size;
60
61 dim_t row_block_size;
62 dim_t col_block_size;
63 dim_t block_size;
64
65 Paso_Distribution *row_distribution;
66 Paso_Distribution *col_distribution;
67 Paso_MPIInfo *mpi_info;
68
69 Paso_Coupler* col_coupler;
70 Paso_Coupler* row_coupler;
71 /* this comes into play when PASO is used */
72 Paso_SparseMatrix* mainBlock; /* main block */
73 Paso_SparseMatrix* col_coupleBlock; /* coupling to naighbouring processors (row - col) */
74 Paso_SparseMatrix* row_coupleBlock; /* coupling to naighbouring processors (col - row) (uses CSC if coupleBlock uses CSR) */
75 bool_t normalizer_is_valid;
76 double *normalizer; /* vector with a inverse of the absolute row/col sum (set by Solver.c)*/
77 index_t solver_package; /* package controling the solver pointer */
78 void* solver; /* pointer to data needed by a solver */
79
80 /* this is only used for a trilinos matrix */
81 void *trilinos_data;
82
83 } Paso_SystemMatrix;
84
85 /* interfaces: */
86
87
88 PASO_DLL_API
89 Paso_SystemMatrix* Paso_SystemMatrix_alloc(Paso_SystemMatrixType,Paso_SystemMatrixPattern*,dim_t,dim_t);
90
91 PASO_DLL_API
92 Paso_SystemMatrix* Paso_SystemMatrix_reference(Paso_SystemMatrix*);
93
94 PASO_DLL_API
95 void Paso_SystemMatrix_free(Paso_SystemMatrix*);
96
97
98 PASO_DLL_API
99 void Paso_SystemMatrix_MatrixVector(const double alpha, Paso_SystemMatrix* A, const double* in, const double beta, double* out);
100
101 PASO_DLL_API
102 void Paso_SystemMatrix_MatrixVector_CSR_OFFSET0(double alpha, Paso_SystemMatrix* A, const double* in, const double beta, double* out);
103
104 PASO_DLL_API
105 void Paso_solve(Paso_SystemMatrix* A, double* out, double* in, Paso_Options* options);
106
107 PASO_DLL_API
108 void Paso_solve_free(Paso_SystemMatrix* in);
109
110 PASO_DLL_API
111 void Paso_SystemMatrix_startCollect(Paso_SystemMatrix* A,const double* in);
112
113 PASO_DLL_API
114 double* Paso_SystemMatrix_finishCollect(Paso_SystemMatrix* A);
115
116 PASO_DLL_API
117 void Paso_SystemMatrix_startColCollect(Paso_SystemMatrix* A,const double* in);
118
119 PASO_DLL_API
120 double* Paso_SystemMatrix_finishColCollect(Paso_SystemMatrix* A);
121
122 PASO_DLL_API
123 void Paso_SystemMatrix_startRowCollect(Paso_SystemMatrix* A,const double* in);
124
125 PASO_DLL_API
126 double* Paso_SystemMatrix_finishRowCollect(Paso_SystemMatrix* A);
127
128 PASO_DLL_API
129 void Paso_SystemMatrix_nullifyRowsAndCols(Paso_SystemMatrix* A, double* mask_row, double* mask_col, double main_diagonal_value);
130
131 PASO_DLL_API
132 double* Paso_SystemMatrix_borrowNormalization(Paso_SystemMatrix* A);
133
134 PASO_DLL_API
135 dim_t Paso_SystemMatrix_getTotalNumRows(const Paso_SystemMatrix* A);
136
137 PASO_DLL_API
138 dim_t Paso_SystemMatrix_getTotalNumCols(const Paso_SystemMatrix*);
139
140 PASO_DLL_API
141 dim_t Paso_SystemMatrix_getGlobalNumRows(Paso_SystemMatrix*);
142
143 PASO_DLL_API
144 dim_t Paso_SystemMatrix_getGlobalNumCols(Paso_SystemMatrix*);
145
146
147 PASO_DLL_API
148 void Paso_SystemMatrix_saveMM(Paso_SystemMatrix *, char *);
149
150 PASO_DLL_API
151 void Paso_SystemMatrix_saveHB(Paso_SystemMatrix *, char *);
152
153 PASO_DLL_API
154 Paso_SystemMatrix* Paso_SystemMatrix_loadMM_toCSR(char *);
155
156 PASO_DLL_API
157 Paso_SystemMatrix* Paso_SystemMatrix_loadMM_toCSC(char *);
158
159 PASO_DLL_API
160 void Paso_SystemMatrix_setDefaults(Paso_Options*);
161
162 PASO_DLL_API
163 int Paso_SystemMatrix_getSystemMatrixTypeId(const index_t solver,const index_t preconditioner, const index_t package,const bool_t symmetry);
164
165 PASO_DLL_API
166 dim_t Paso_SystemMatrix_getNumOutput(Paso_SystemMatrix* A);
167
168 PASO_DLL_API
169 void Paso_SystemMatrix_setValues(Paso_SystemMatrix*,double);
170
171 PASO_DLL_API
172 void Paso_SystemMatrix_add(Paso_SystemMatrix*,dim_t,index_t*, dim_t,dim_t,index_t*,dim_t, double*);
173
174 PASO_DLL_API
175 void Paso_SystemMatrix_rowSum(Paso_SystemMatrix* A, double* row_sum);
176
177 PASO_DLL_API
178 void Paso_SystemMatrix_nullifyRows(Paso_SystemMatrix* A, double* mask_row, double main_diagonal_value);
179
180 PASO_DLL_API
181 void Paso_SparseMatrix_nullifyRows_CSR(Paso_SparseMatrix*, double*, double);
182
183
184 #endif /* #ifndef INC_PASO_SYSTEMMATRIX */
185

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26