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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1552 - (hide annotations)
Thu May 8 08:52:41 2008 UTC (11 years, 9 months ago) by gross
File MIME type: text/plain
File size: 4916 byte(s)
some changes to make the implementatiopn of a upwind MPI version easier
1 ksteube 1312
2 jgs 150 /* $Id$ */
3    
4 ksteube 1312 /*******************************************************
5     *
6     * Copyright 2003-2007 by ACceSS MNRF
7     * Copyright 2007 by University of Queensland
8     *
9     * http://esscc.uq.edu.au
10     * Primary Business: Queensland, Australia
11     * Licensed under the Open Software License version 3.0
12     * http://www.opensource.org/licenses/osl-3.0.php
13     *
14     *******************************************************/
15 dhawcroft 631
16 jgs 150 /**************************************************************/
17    
18     /* Paso: SystemMatrix and SystemVector */
19    
20     /**************************************************************/
21    
22 gross 412 /* Copyrights by ACcESS Australia 2003,2004,2005,2006 */
23 jgs 150 /* Author: gross@access.edu.au */
24    
25     /**************************************************************/
26    
27 ksteube 1312 #ifndef INC_PASO_SYSTEMMATRIX
28     #define INC_PASO_SYSTEMMATRIX
29 jgs 150
30     #include "Common.h"
31 ksteube 1312 #include "SparseMatrix.h"
32 jgs 150 #include "SystemMatrixPattern.h"
33     #include "Options.h"
34 ksteube 1312 #include "Paso_MPI.h"
35     #include "Paso.h"
36 gross 1552 #include "Coupler.h"
37 jgs 150
38 gross 1552
39 jgs 150 /**************************************************************/
40    
41     /* this struct holds a stiffness matrix: */
42    
43 gross 415 #define MATRIX_FORMAT_DEFAULT 0
44     #define MATRIX_FORMAT_CSC 1
45     #define MATRIX_FORMAT_SYM 2
46     #define MATRIX_FORMAT_BLK1 4
47     #define MATRIX_FORMAT_OFFSET1 8
48 ksteube 1312 #define MATRIX_FORMAT_TRILINOS_CRS 16
49 gross 412
50 jgs 150 typedef int Paso_SystemMatrixType;
51    
52     typedef struct Paso_SystemMatrix {
53     Paso_SystemMatrixType type;
54 ksteube 1312 Paso_SystemMatrixPattern *pattern;
55    
56 jgs 150 dim_t reference_counter;
57    
58     dim_t logical_row_block_size;
59     dim_t logical_col_block_size;
60     dim_t logical_block_size;
61    
62     dim_t row_block_size;
63     dim_t col_block_size;
64     dim_t block_size;
65    
66 ksteube 1312 Paso_Distribution *row_distribution;
67     Paso_Distribution *col_distribution;
68     Paso_MPIInfo *mpi_info;
69 jgs 150
70 gross 1552 Paso_Coupler* col_coupler;
71     Paso_Coupler* row_coupler;
72 ksteube 1312 /* this comes into play when PASO is used */
73 gross 1552 Paso_SparseMatrix* mainBlock; /* main block */
74     Paso_SparseMatrix* col_coupleBlock; /* coupling to naighbouring processors (row - col) */
75     Paso_SparseMatrix* row_coupleBlock; /* coupling to naighbouring processors (col - row) (uses CSC if coupleBlock uses CSR) */
76 ksteube 1312 bool_t normalizer_is_valid;
77 jgs 150 double *normalizer; /* vector with a inverse of the absolute row/col sum (set by Solver.c)*/
78 gross 425 index_t solver_package; /* package controling the solver pointer */
79     void* solver; /* pointer to data needed by a solver */
80 jgs 150
81 ksteube 1312 /* this is only used for a trilinos matrix */
82     void *trilinos_data;
83    
84 jgs 150 } Paso_SystemMatrix;
85    
86     /* interfaces: */
87    
88     Paso_SystemMatrix* Paso_SystemMatrix_alloc(Paso_SystemMatrixType,Paso_SystemMatrixPattern*,dim_t,dim_t);
89     Paso_SystemMatrix* Paso_SystemMatrix_reference(Paso_SystemMatrix*);
90 ksteube 1312 void Paso_SystemMatrix_free(Paso_SystemMatrix*);
91 jgs 150
92     void Paso_SystemMatrix_MatrixVector(double alpha, Paso_SystemMatrix* A, double* in, double beta, double* out);
93 gross 415 void Paso_SystemMatrix_MatrixVector_CSR_OFFSET0(double alpha, Paso_SystemMatrix* A, double* in, double beta, double* out);
94 ksteube 1312 void Paso_solve(Paso_SystemMatrix* A, double* out, double* in, Paso_Options* options);
95     void Paso_solve_free(Paso_SystemMatrix* in);
96 gross 1407 void Paso_SystemMatrix_startCollect(Paso_SystemMatrix* A,const double* in);
97 ksteube 1312 double* Paso_SystemMatrix_finishCollect(Paso_SystemMatrix* A);
98 gross 1552 void Paso_SystemMatrix_startColCollect(Paso_SystemMatrix* A,const double* in);
99     double* Paso_SystemMatrix_finishColCollect(Paso_SystemMatrix* A);
100     void Paso_SystemMatrix_startRowCollect(Paso_SystemMatrix* A,const double* in);
101     double* Paso_SystemMatrix_finishRowCollect(Paso_SystemMatrix* A);
102 ksteube 1312 void Paso_SystemMatrix_nullifyRowsAndCols(Paso_SystemMatrix* A, double* mask_row, double* mask_col, double main_diagonal_value);
103     double* Paso_SystemMatrix_borrowNormalization(Paso_SystemMatrix* A);
104 gross 1407 dim_t Paso_SystemMatrix_getTotalNumRows(const Paso_SystemMatrix* A);
105     dim_t Paso_SystemMatrix_getTotalNumCols(const Paso_SystemMatrix*);
106 ksteube 1312 dim_t Paso_SystemMatrix_getGlobalNumRows(Paso_SystemMatrix*);
107     dim_t Paso_SystemMatrix_getGlobalNumCols(Paso_SystemMatrix*);
108 jgs 150
109     void Paso_SystemMatrix_saveMM(Paso_SystemMatrix *, char *);
110     void Paso_SystemMatrix_saveHB(Paso_SystemMatrix *, char *);
111     Paso_SystemMatrix* Paso_SystemMatrix_loadMM_toCSR(char *);
112 ksteube 1312 Paso_SystemMatrix* Paso_SystemMatrix_loadMM_toCSC(char *);
113 jgs 150 void Paso_SystemMatrix_setDefaults(Paso_Options*);
114     int Paso_SystemMatrix_getSystemMatrixTypeId(index_t solver, index_t package, bool_t symmetry);
115 gross 1361 dim_t Paso_SystemMatrix_getNumOutput(Paso_SystemMatrix* A);
116 ksteube 1312 void Paso_SystemMatrix_setValues(Paso_SystemMatrix*,double);
117     void Paso_SystemMatrix_add(Paso_SystemMatrix*,dim_t,index_t*, dim_t,dim_t,index_t*,dim_t, double*);
118 gross 1363 void Paso_SystemMatrix_rowSum(Paso_SystemMatrix* A, double* row_sum);
119 gross 1417 void Paso_SystemMatrix_nullifyRows(Paso_SystemMatrix* A, double* mask_row, double main_diagonal_value);
120 artak 1425 void Paso_SparseMatrix_nullifyRows_CSR(Paso_SparseMatrix*, double*, double);
121 jgs 150
122 ksteube 1312 #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