/[escript]/trunk/paso/src/SystemMatrix.h
ViewVC logotype

Contents of /trunk/paso/src/SystemMatrix.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1028 - (show annotations)
Wed Mar 14 00:15:24 2007 UTC (12 years, 11 months ago) by gross
File MIME type: text/plain
File size: 4469 byte(s)
modifications to be compliant with _WIN32. The substitutes for asinh, acosh, atanh are still missing (erf will through an exception)
1 /* $Id$ */
2
3
4 /*
5 ********************************************************************************
6 * Copyright 2006 by ACcESS MNRF *
7 * *
8 * http://www.access.edu.au *
9 * Primary Business: Queensland, Australia *
10 * Licensed under the Open Software License version 3.0 *
11 * http://www.opensource.org/licenses/osl-3.0.php *
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_SYSTEM
27 #define INC_PASO_SYSTEM
28
29 #include "Common.h"
30 #include "SystemMatrixPattern.h"
31 #include "Options.h"
32
33 /**************************************************************/
34
35 /* this struct holds a stiffness matrix: */
36
37 #define MATRIX_FORMAT_DEFAULT 0
38 #define MATRIX_FORMAT_CSC 1
39 #define MATRIX_FORMAT_SYM 2
40 #define MATRIX_FORMAT_BLK1 4
41 #define MATRIX_FORMAT_OFFSET1 8
42
43 typedef int Paso_SystemMatrixType;
44
45 typedef struct Paso_SystemMatrix {
46 /*
47 #ifdef PASO_MPI
48 Paso_CommBuffer *CommBuffer;
49 Paso_MPIInfo *MPIInfo;
50 dim_t numLocal;
51 dim_t numInternal;
52 dim_t numBoundary;
53 dim_t numExternal;
54 dim_t *vtxdist;
55 #endif
56 */
57 Paso_SystemMatrixType type;
58 dim_t reference_counter;
59
60 dim_t logical_row_block_size;
61 dim_t logical_col_block_size;
62 dim_t logical_block_size;
63
64 dim_t row_block_size;
65 dim_t col_block_size;
66 dim_t block_size;
67
68 dim_t num_rows;
69 dim_t num_cols;
70
71 Paso_SystemMatrixPattern* pattern;
72
73 dim_t len;
74 double *val;
75
76 double *normalizer; /* vector with a inverse of the absolute row/col sum (set by Solver.c)*/
77 bool_t normalizer_is_valid;
78 index_t solver_package; /* package controling the solver pointer */
79 void* solver; /* pointer to data needed by a solver */
80
81 } Paso_SystemMatrix;
82
83 /* interfaces: */
84
85 Paso_SystemMatrix* Paso_SystemMatrix_alloc(Paso_SystemMatrixType,Paso_SystemMatrixPattern*,dim_t,dim_t);
86 Paso_SystemMatrix* Paso_SystemMatrix_reference(Paso_SystemMatrix*);
87 void Paso_SystemMatrix_dealloc(Paso_SystemMatrix*);
88
89 void Paso_SystemMatrix_setValues(Paso_SystemMatrix*,double);
90 void Paso_SystemMatrix_copy(Paso_SystemMatrix*,double*);
91 void Paso_SystemMatrix_add(Paso_SystemMatrix*,dim_t,index_t*, dim_t,dim_t,index_t*,dim_t, double*);
92 void Paso_SystemMatrix_MatrixVector(double alpha, Paso_SystemMatrix* A, double* in, double beta, double* out);
93 void Paso_SystemMatrix_MatrixVector_CSC_OFFSET0(double alpha, Paso_SystemMatrix* A, double* in, double beta, double* out);
94 void Paso_SystemMatrix_MatrixVector_CSC_OFFSET1(double alpha, Paso_SystemMatrix* A, double* in, double beta, double* out);
95 void Paso_SystemMatrix_MatrixVector_CSR_OFFSET0(double alpha, Paso_SystemMatrix* A, double* in, double beta, double* out);
96 void Paso_SystemMatrix_MatrixVector_CSR_OFFSET1(double alpha, Paso_SystemMatrix* A, double* in, double beta, double* out);
97
98 void Paso_SystemMatrix_saveMM(Paso_SystemMatrix *, char *);
99 void Paso_SystemMatrix_saveHB(Paso_SystemMatrix *, char *);
100 Paso_SystemMatrix* Paso_SystemMatrix_loadMM_toCSR(char *);
101 void Paso_SystemMatrix_nullifyRowsAndCols(Paso_SystemMatrix* A, double* mask_row, double* mask_col, double main_diagonal_value);
102 void Paso_SystemMatrix_setDefaults(Paso_Options*);
103 int Paso_SystemMatrix_getSystemMatrixTypeId(index_t solver, index_t package, bool_t symmetry);
104 Paso_SystemMatrix* Paso_SystemMatrix_getSubmatrix(Paso_SystemMatrix* A,dim_t,index_t*,index_t*);
105 double* Paso_SystemMatrix_borrowNormalization(Paso_SystemMatrix* A);
106
107 #endif /* #ifndef INC_PASO_SYSTEM */
108
109 /*
110 * $Log$
111 * Revision 1.2 2005/09/15 03:44:38 jgs
112 * Merge of development branch dev-02 back to main trunk on 2005-09-15
113 *
114 * Revision 1.1.2.2 2005/09/07 00:59:08 gross
115 * some inconsistent renaming fixed to make the linking work.
116 *
117 * Revision 1.1.2.1 2005/09/05 06:29:47 gross
118 * These files have been extracted from finley to define a stand alone libray for iterative
119 * linear solvers on the ALTIX. main entry through Paso_solve. this version compiles but
120 * has not been tested yet.
121 *
122 *
123 */

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26