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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2881 - (hide annotations)
Thu Jan 28 02:03:15 2010 UTC (9 years, 5 months ago) by jfenwick
File MIME type: text/plain
File size: 5071 byte(s)
Don't panic.
Updating copyright stamps

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