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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 633 - (hide annotations)
Thu Mar 23 05:37:00 2006 UTC (13 years, 11 months ago) by dhawcroft
File MIME type: text/plain
File size: 4290 byte(s)


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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26