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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 969 - (show annotations)
Tue Feb 13 23:02:23 2007 UTC (13 years ago) by ksteube
File MIME type: text/plain
File size: 4426 byte(s)
Parallelization using MPI for solution of implicit problems.

Parallelization for explicit problems has already been accomplished in
the main SVN branch.

This is incomplete and is not ready for use.


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 //#include "CommBuffer.h"
34 //#include "Paso_MPI.h"
35
36 /**************************************************************/
37
38 /* this struct holds a stiffness matrix: */
39
40 #define MATRIX_FORMAT_DEFAULT 0
41 #define MATRIX_FORMAT_CSC 1
42 #define MATRIX_FORMAT_SYM 2
43 #define MATRIX_FORMAT_BLK1 4
44 #define MATRIX_FORMAT_OFFSET1 8
45 #define MATRIX_FORMAT_TRILINOS_CRS 16
46
47 typedef int Paso_SystemMatrixType;
48
49 typedef struct Paso_SystemMatrix {
50 Paso_SystemMatrixType type;
51 dim_t reference_counter;
52
53 dim_t logical_row_block_size;
54 dim_t logical_col_block_size;
55 dim_t logical_block_size;
56
57 dim_t row_block_size;
58 dim_t col_block_size;
59 dim_t block_size;
60
61 dim_t num_rows;
62 dim_t num_cols;
63
64 Paso_SystemMatrixPattern* pattern;
65
66 dim_t len;
67 double *val;
68
69 double *normalizer; /* vector with a inverse of the absolute row/col sum (set by Solver.c)*/
70 bool_t normalizer_is_valid;
71 index_t solver_package; /* package controling the solver pointer */
72 void* solver; /* pointer to data needed by a solver */
73
74 #ifdef TRILINOS
75 void *trilinos_data;
76 #endif
77
78 } Paso_SystemMatrix;
79
80 /* interfaces: */
81
82 Paso_SystemMatrix* Paso_SystemMatrix_alloc(Paso_SystemMatrixType,Paso_SystemMatrixPattern*,dim_t,dim_t);
83 Paso_SystemMatrix* Paso_SystemMatrix_reference(Paso_SystemMatrix*);
84 void Paso_SystemMatrix_dealloc(Paso_SystemMatrix*);
85
86 void Paso_SystemMatrix_setValues(Paso_SystemMatrix*,double);
87 void Paso_SystemMatrix_copy(Paso_SystemMatrix*,double*);
88 void Paso_SystemMatrix_add(Paso_SystemMatrix*,dim_t,index_t*, dim_t,dim_t,index_t*,dim_t, double*);
89 void Paso_SystemMatrix_MatrixVector(double alpha, Paso_SystemMatrix* A, double* in, double beta, double* out);
90 void Paso_SystemMatrix_MatrixVector_CSC_OFFSET0(double alpha, Paso_SystemMatrix* A, double* in, double beta, double* out);
91 void Paso_SystemMatrix_MatrixVector_CSC_OFFSET1(double alpha, Paso_SystemMatrix* A, double* in, double beta, double* out);
92 void Paso_SystemMatrix_MatrixVector_CSR_OFFSET0(double alpha, Paso_SystemMatrix* A, double* in, double beta, double* out);
93 void Paso_SystemMatrix_MatrixVector_CSR_OFFSET1(double alpha, Paso_SystemMatrix* A, double* in, double beta, double* out);
94
95 void Paso_SystemMatrix_saveMM(Paso_SystemMatrix *, char *);
96 void Paso_SystemMatrix_saveHB(Paso_SystemMatrix *, char *);
97 Paso_SystemMatrix* Paso_SystemMatrix_loadMM_toCSR(char *);
98 void Paso_SystemMatrix_nullifyRowsAndCols(Paso_SystemMatrix* A, double* mask_row, double* mask_col, double main_diagonal_value);
99 void Paso_SystemMatrix_setDefaults(Paso_Options*);
100 int Paso_SystemMatrix_getSystemMatrixTypeId(index_t solver, index_t package, bool_t symmetry);
101 Paso_SystemMatrix* Paso_SystemMatrix_getSubmatrix(Paso_SystemMatrix* A,dim_t,index_t*,index_t*);
102 double* Paso_SystemMatrix_borrowNormalization(Paso_SystemMatrix* A);
103
104 #endif /* #ifndef INC_PASO_SYSTEM */
105
106 /*
107 * $Log$
108 * Revision 1.2 2005/09/15 03:44:38 jgs
109 * Merge of development branch dev-02 back to main trunk on 2005-09-15
110 *
111 * Revision 1.1.2.2 2005/09/07 00:59:08 gross
112 * some inconsistent renaming fixed to make the linking work.
113 *
114 * Revision 1.1.2.1 2005/09/05 06:29:47 gross
115 * These files have been extracted from finley to define a stand alone libray for iterative
116 * linear solvers on the ALTIX. main entry through Paso_solve. this version compiles but
117 * has not been tested yet.
118 *
119 *
120 */

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26