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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 425 - (hide annotations)
Tue Jan 10 04:10:39 2006 UTC (14 years, 1 month ago) by gross
File MIME type: text/plain
File size: 3644 byte(s)
The sparse solver can be called by paso now. 

the building has been change to reduce some code redundancy:
now all scons SCscripts are importing scons/esys_options.py which
imports platform specific settings. 



1 jgs 150 /* $Id$ */
2    
3     /**************************************************************/
4    
5     /* Paso: SystemMatrix and SystemVector */
6    
7     /**************************************************************/
8    
9 gross 412 /* Copyrights by ACcESS Australia 2003,2004,2005,2006 */
10 jgs 150 /* Author: gross@access.edu.au */
11    
12     /**************************************************************/
13    
14     #ifndef INC_PASO_SYSTEM
15     #define INC_PASO_SYSTEM
16    
17     #include "Common.h"
18     #include "SystemMatrixPattern.h"
19     #include "Options.h"
20    
21     /**************************************************************/
22    
23     /* this struct holds a stiffness matrix: */
24    
25 gross 415 #define MATRIX_FORMAT_DEFAULT 0
26     #define MATRIX_FORMAT_CSC 1
27     #define MATRIX_FORMAT_SYM 2
28     #define MATRIX_FORMAT_BLK1 4
29     #define MATRIX_FORMAT_OFFSET1 8
30 gross 412
31 jgs 150 typedef int Paso_SystemMatrixType;
32    
33     typedef struct Paso_SystemMatrix {
34     Paso_SystemMatrixType type;
35     dim_t reference_counter;
36    
37     dim_t logical_row_block_size;
38     dim_t logical_col_block_size;
39     dim_t logical_block_size;
40    
41     dim_t row_block_size;
42     dim_t col_block_size;
43     dim_t block_size;
44    
45     dim_t num_rows;
46     dim_t num_cols;
47    
48     Paso_SystemMatrixPattern* pattern;
49    
50     dim_t len;
51     double *val;
52    
53     double *normalizer; /* vector with a inverse of the absolute row/col sum (set by Solver.c)*/
54     bool_t normalizer_is_valid;
55 gross 425 index_t solver_package; /* package controling the solver pointer */
56     void* solver; /* pointer to data needed by a solver */
57 jgs 150
58     } Paso_SystemMatrix;
59    
60     /* interfaces: */
61    
62     Paso_SystemMatrix* Paso_SystemMatrix_alloc(Paso_SystemMatrixType,Paso_SystemMatrixPattern*,dim_t,dim_t);
63     Paso_SystemMatrix* Paso_SystemMatrix_reference(Paso_SystemMatrix*);
64     void Paso_SystemMatrix_dealloc(Paso_SystemMatrix*);
65    
66     void Paso_SystemMatrix_setValues(Paso_SystemMatrix*,double);
67     void Paso_SystemMatrix_copy(Paso_SystemMatrix*,double*);
68     void Paso_SystemMatrix_add(Paso_SystemMatrix*,dim_t,index_t*, dim_t,dim_t,index_t*,dim_t, double*);
69     void Paso_SystemMatrix_MatrixVector(double alpha, Paso_SystemMatrix* A, double* in, double beta, double* out);
70 gross 415 void Paso_SystemMatrix_MatrixVector_CSC_OFFSET0(double alpha, Paso_SystemMatrix* A, double* in, double beta, double* out);
71     void Paso_SystemMatrix_MatrixVector_CSC_OFFSET1(double alpha, Paso_SystemMatrix* A, double* in, double beta, double* out);
72     void Paso_SystemMatrix_MatrixVector_CSR_OFFSET0(double alpha, Paso_SystemMatrix* A, double* in, double beta, double* out);
73     void Paso_SystemMatrix_MatrixVector_CSR_OFFSET1(double alpha, Paso_SystemMatrix* A, double* in, double beta, double* out);
74 jgs 150
75     void Paso_SystemMatrix_saveMM(Paso_SystemMatrix *, char *);
76     void Paso_SystemMatrix_saveHB(Paso_SystemMatrix *, char *);
77     Paso_SystemMatrix* Paso_SystemMatrix_loadMM_toCSR(char *);
78     void Paso_SystemMatrix_nullifyRowsAndCols(Paso_SystemMatrix* A, double* mask_row, double* mask_col, double main_diagonal_value);
79     void Paso_SystemMatrix_setDefaults(Paso_Options*);
80     int Paso_SystemMatrix_getSystemMatrixTypeId(index_t solver, index_t package, bool_t symmetry);
81     Paso_SystemMatrix* Paso_SystemMatrix_getSubmatrix(Paso_SystemMatrix* A,dim_t,index_t*,index_t*);
82     double* Paso_SystemMatrix_borrowNormalization(Paso_SystemMatrix* A);
83    
84     #endif /* #ifndef INC_PASO_SYSTEM */
85    
86     /*
87     * $Log$
88     * Revision 1.2 2005/09/15 03:44:38 jgs
89     * Merge of development branch dev-02 back to main trunk on 2005-09-15
90     *
91     * Revision 1.1.2.2 2005/09/07 00:59:08 gross
92     * some inconsistent renaming fixed to make the linking work.
93     *
94     * Revision 1.1.2.1 2005/09/05 06:29:47 gross
95     * These files have been extracted from finley to define a stand alone libray for iterative
96     * linear solvers on the ALTIX. main entry through Paso_solve. this version compiles but
97     * has not been tested yet.
98     *
99     *
100     */

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26