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

Annotation of /trunk-mpi-branch/paso/src/SystemMatrix.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1087 - (hide annotations)
Thu Apr 12 10:01:47 2007 UTC (12 years, 3 months ago) by gross
File MIME type: text/plain
File size: 5716 byte(s)
the MPI version of PASO.PCG is running. 
There is a bug in the rectangular mesh generators but they need to be
revised in any case to clean up the code.


1 jgs 150 /* $Id$ */
2    
3 dhawcroft 631
4     /*
5     ********************************************************************************
6 dhawcroft 633 * Copyright 2006 by ACcESS MNRF *
7 dhawcroft 631 * *
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 jgs 150 /**************************************************************/
16    
17     /* Paso: SystemMatrix and SystemVector */
18    
19     /**************************************************************/
20    
21 gross 412 /* Copyrights by ACcESS Australia 2003,2004,2005,2006 */
22 jgs 150 /* Author: gross@access.edu.au */
23    
24     /**************************************************************/
25    
26 gross 1011 #ifndef INC_PASO_SYSTEMMATRIX
27     #define INC_PASO_SYSTEMMATRIX
28 jgs 150
29     #include "Common.h"
30     #include "SystemMatrixPattern.h"
31     #include "Options.h"
32 gross 1011 #include "Paso_MPI.h"
33     #include "Paso.h"
34 jgs 150
35     /**************************************************************/
36    
37     /* this struct holds a stiffness matrix: */
38    
39 gross 415 #define MATRIX_FORMAT_DEFAULT 0
40     #define MATRIX_FORMAT_CSC 1
41     #define MATRIX_FORMAT_SYM 2
42     #define MATRIX_FORMAT_BLK1 4
43     #define MATRIX_FORMAT_OFFSET1 8
44 ksteube 989 #define MATRIX_FORMAT_TRILINOS_CRS 16
45 gross 412
46 jgs 150 typedef int Paso_SystemMatrixType;
47    
48     typedef struct Paso_SystemMatrix {
49     Paso_SystemMatrixType type;
50     dim_t reference_counter;
51    
52     dim_t logical_row_block_size;
53     dim_t logical_col_block_size;
54     dim_t logical_block_size;
55    
56     dim_t row_block_size;
57     dim_t col_block_size;
58     dim_t block_size;
59    
60 gross 1011 dim_t numRows;
61     dim_t myNumRows;
62 gross 1087 dim_t myFirstRow;
63     dim_t maxNumRows;
64 gross 1011 dim_t numCols;
65     dim_t myNumCols;
66 gross 1087 dim_t myFirstCol;
67     dim_t maxNumCols;
68 jgs 150
69 gross 1011 Paso_MPIInfo *mpi_info;
70 jgs 150 Paso_SystemMatrixPattern* pattern;
71 gross 1011 Paso_Distribution *row_distribution;
72     Paso_Distribution *col_distribution;
73 jgs 150
74 gross 1011 dim_t myLen;
75     double *val; /* this is used for classical CSR or CSC */
76     void *trilinos_data; /* this is only used for a trilinos matrix */
77 jgs 150
78     double *normalizer; /* vector with a inverse of the absolute row/col sum (set by Solver.c)*/
79     bool_t normalizer_is_valid;
80 gross 425 index_t solver_package; /* package controling the solver pointer */
81     void* solver; /* pointer to data needed by a solver */
82 jgs 150
83     } Paso_SystemMatrix;
84    
85     /* interfaces: */
86    
87     Paso_SystemMatrix* Paso_SystemMatrix_alloc(Paso_SystemMatrixType,Paso_SystemMatrixPattern*,dim_t,dim_t);
88     Paso_SystemMatrix* Paso_SystemMatrix_reference(Paso_SystemMatrix*);
89     void Paso_SystemMatrix_dealloc(Paso_SystemMatrix*);
90    
91     void Paso_SystemMatrix_setValues(Paso_SystemMatrix*,double);
92     void Paso_SystemMatrix_copy(Paso_SystemMatrix*,double*);
93     void Paso_SystemMatrix_add(Paso_SystemMatrix*,dim_t,index_t*, dim_t,dim_t,index_t*,dim_t, double*);
94     void Paso_SystemMatrix_MatrixVector(double alpha, Paso_SystemMatrix* A, double* in, double beta, double* out);
95 gross 415 void Paso_SystemMatrix_MatrixVector_CSC_OFFSET0(double alpha, Paso_SystemMatrix* A, double* in, double beta, double* out);
96     void Paso_SystemMatrix_MatrixVector_CSC_OFFSET1(double alpha, Paso_SystemMatrix* A, double* in, double beta, double* out);
97 gross 1087 void Paso_SystemMatrix_MatrixVector_CSR_OFFSET0(double alpha, Paso_SystemMatrix* A, double* in, double beta, double* out, double* buffer0, double* buffer1);
98     void Paso_SystemMatrix_MatrixVector_CSR_OFFSET0_S(double alpha, Paso_SystemMatrix* A, double* in, double* out);
99     void Paso_SystemMatrix_MatrixVector_CSR_OFFSET0_P(double alpha, Paso_SystemMatrix* A, double* in, index_t min_index, index_t max_index, double* out);
100 gross 415 void Paso_SystemMatrix_MatrixVector_CSR_OFFSET1(double alpha, Paso_SystemMatrix* A, double* in, double beta, double* out);
101 jgs 150
102     void Paso_SystemMatrix_saveMM(Paso_SystemMatrix *, char *);
103     void Paso_SystemMatrix_saveHB(Paso_SystemMatrix *, char *);
104     Paso_SystemMatrix* Paso_SystemMatrix_loadMM_toCSR(char *);
105     void Paso_SystemMatrix_nullifyRowsAndCols(Paso_SystemMatrix* A, double* mask_row, double* mask_col, double main_diagonal_value);
106 gross 1087 void Paso_SystemMatrix_nullifyRowsAndCols_CSC_BLK1(Paso_SystemMatrix* A, double* mask_row, double* mask_col, double main_diagonal_value);
107     void Paso_SystemMatrix_nullifyRowsAndCols_CSR_BLK1(Paso_SystemMatrix* A, double* mask_row, double* mask_col, double main_diagonal_value);
108     void Paso_SystemMatrix_nullifyRowsAndCols_CSC(Paso_SystemMatrix* A, double* mask_row, double* mask_col, double main_diagonal_value);
109     void Paso_SystemMatrix_nullifyRowsAndCols_CSR(Paso_SystemMatrix* A, double* mask_row, double* mask_col, double main_diagonal_value);
110     void Paso_SystemMatrix_nullifyRows_CSR(Paso_SystemMatrix* A, double* mask_row, double main_diagonal_value);
111     void Paso_SystemMatrix_nullifyRows_CSR_BLK1(Paso_SystemMatrix* A, double* mask_row, double main_diagonal_value);
112     void Paso_SystemMatrix_nullifyCols_CSR(Paso_SystemMatrix* A, double* mask_col, double main_diagonal_value, index_t min_index, index_t max_index);
113     void Paso_SystemMatrix_nullifyCols_CSR_BLK1(Paso_SystemMatrix* A, double* mask_col, double main_diagonal_value, index_t min_index, index_t max_index);
114 jgs 150 void Paso_SystemMatrix_setDefaults(Paso_Options*);
115     int Paso_SystemMatrix_getSystemMatrixTypeId(index_t solver, index_t package, bool_t symmetry);
116 gross 1011 Paso_SystemMatrix* Paso_SystemMatrix_getSubmatrix(Paso_SystemMatrix* A,dim_t,dim_t,index_t*,index_t*);
117 jgs 150 double* Paso_SystemMatrix_borrowNormalization(Paso_SystemMatrix* A);
118    
119 gross 1011 void Paso_solve(Paso_SystemMatrix* A, double* out, double* in, Paso_Options* options);
120     void Paso_solve_free(Paso_SystemMatrix* in);
121 jgs 150
122 gross 1011 #endif /* #ifndef INC_PASO_SYSTEMMATRIX */
123    

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26