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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2608 - (show annotations)
Tue Aug 18 01:25:18 2009 UTC (10 years, 2 months ago) by jfenwick
File MIME type: text/plain
File size: 5071 byte(s)
Updating Lutz' email

1
2 /*******************************************************
3 *
4 * Copyright (c) 2003-2009 by University of Queensland
5 * 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
14
15 /**************************************************************/
16
17 /* Paso: SystemMatrix and SystemVector */
18
19 /**************************************************************/
20
21 /* Copyrights by ACcESS Australia 2003,2004,2005,2006 */
22 /* Author: Lutz Gross, l.gross@uq.edu.au */
23
24 /**************************************************************/
25
26 #ifndef INC_PASO_SYSTEMMATRIX
27 #define INC_PASO_SYSTEMMATRIX
28
29 #include "Common.h"
30 #include "SparseMatrix.h"
31 #include "SystemMatrixPattern.h"
32 #include "Options.h"
33 #include "Paso_MPI.h"
34 #include "Paso.h"
35 #include "Coupler.h"
36
37
38 /**************************************************************/
39
40 /* this struct holds a stiffness matrix: */
41
42 #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 #define MATRIX_FORMAT_TRILINOS_CRS 16
48
49 typedef int Paso_SystemMatrixType;
50
51 typedef struct Paso_SystemMatrix {
52 Paso_SystemMatrixType type;
53 Paso_SystemMatrixPattern *pattern;
54
55 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 Paso_Distribution *row_distribution;
65 Paso_Distribution *col_distribution;
66 Paso_MPIInfo *mpi_info;
67
68 Paso_Coupler* col_coupler;
69 Paso_Coupler* row_coupler;
70 /* this comes into play when PASO is used */
71 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 bool_t normalizer_is_valid;
75 double *normalizer; /* vector with a inverse of the absolute row/col sum (set by Solver.c)*/
76 index_t solver_package; /* package controling the solver pointer */
77 void* solver; /* pointer to data needed by a solver */
78
79 /* this is only used for a trilinos matrix */
80 void *trilinos_data;
81
82 } Paso_SystemMatrix;
83
84 /* interfaces: */
85
86 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 void Paso_SystemMatrix_free(Paso_SystemMatrix*);
89
90 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 void Paso_solve(Paso_SystemMatrix* A, double* out, double* in, Paso_Options* options);
93 void Paso_solve_free(Paso_SystemMatrix* in);
94 void Paso_SystemMatrix_startCollect(Paso_SystemMatrix* A,const double* in);
95 double* Paso_SystemMatrix_finishCollect(Paso_SystemMatrix* A);
96 void Paso_SystemMatrix_startColCollect(Paso_SystemMatrix* A,const double* in);
97 double* Paso_SystemMatrix_finishColCollect(Paso_SystemMatrix* A);
98 void Paso_SystemMatrix_startRowCollect(Paso_SystemMatrix* A,const double* in);
99 double* Paso_SystemMatrix_finishRowCollect(Paso_SystemMatrix* A);
100 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 dim_t Paso_SystemMatrix_getTotalNumRows(const Paso_SystemMatrix* A);
103 dim_t Paso_SystemMatrix_getTotalNumCols(const Paso_SystemMatrix*);
104 dim_t Paso_SystemMatrix_getGlobalNumRows(Paso_SystemMatrix*);
105 dim_t Paso_SystemMatrix_getGlobalNumCols(Paso_SystemMatrix*);
106
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 Paso_SystemMatrix* Paso_SystemMatrix_loadMM_toCSC(char *);
111 void Paso_RHS_loadMM_toCSR( char *fileName_p, double *b, dim_t size);
112 void Paso_SystemMatrix_setDefaults(Paso_Options*);
113 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 dim_t Paso_SystemMatrix_getNumOutput(Paso_SystemMatrix* A);
115 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 void Paso_SystemMatrix_rowSum(Paso_SystemMatrix* A, double* row_sum);
118 void Paso_SystemMatrix_nullifyRows(Paso_SystemMatrix* A, double* mask_row, double main_diagonal_value);
119 void Paso_SparseMatrix_nullifyRows_CSR(Paso_SparseMatrix*, double*, double);
120
121
122 #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