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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2107 - (hide annotations)
Fri Nov 28 04:39:07 2008 UTC (12 years, 8 months ago) by artak
File MIME type: text/plain
File size: 4960 byte(s)
Current version of AMG uses ILU for relaxation, however it is not stable when schur matrix becames more denser. For example it is not stable for -e paramenter is more 400 in 2D for convection problem 
1 ksteube 1312
2     /*******************************************************
3 ksteube 1811 *
4     * Copyright (c) 2003-2008 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 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 jgs 150 /* Author: gross@access.edu.au */
23    
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     dim_t logical_block_size;
60    
61     dim_t row_block_size;
62     dim_t col_block_size;
63     dim_t block_size;
64    
65 ksteube 1312 Paso_Distribution *row_distribution;
66     Paso_Distribution *col_distribution;
67     Paso_MPIInfo *mpi_info;
68 jgs 150
69 gross 1552 Paso_Coupler* col_coupler;
70     Paso_Coupler* row_coupler;
71 ksteube 1312 /* this comes into play when PASO is used */
72 gross 1552 Paso_SparseMatrix* mainBlock; /* main block */
73     Paso_SparseMatrix* col_coupleBlock; /* coupling to naighbouring processors (row - col) */
74     Paso_SparseMatrix* row_coupleBlock; /* coupling to naighbouring processors (col - row) (uses CSC if coupleBlock uses CSR) */
75 ksteube 1312 bool_t normalizer_is_valid;
76 jgs 150 double *normalizer; /* vector with a inverse of the absolute row/col sum (set by Solver.c)*/
77 gross 425 index_t solver_package; /* package controling the solver pointer */
78     void* solver; /* pointer to data needed by a solver */
79 jgs 150
80 ksteube 1312 /* this is only used for a trilinos matrix */
81     void *trilinos_data;
82    
83 jgs 150 } Paso_SystemMatrix;
84    
85     /* interfaces: */
86    
87     Paso_SystemMatrix* Paso_SystemMatrix_alloc(Paso_SystemMatrixType,Paso_SystemMatrixPattern*,dim_t,dim_t);
88     Paso_SystemMatrix* Paso_SystemMatrix_reference(Paso_SystemMatrix*);
89 ksteube 1312 void Paso_SystemMatrix_free(Paso_SystemMatrix*);
90 jgs 150
91 gross 1639 void Paso_SystemMatrix_MatrixVector(const double alpha, Paso_SystemMatrix* A, const double* in, const double beta, double* out);
92     void Paso_SystemMatrix_MatrixVector_CSR_OFFSET0(double alpha, Paso_SystemMatrix* A, const double* in, const double beta, double* out);
93 ksteube 1312 void Paso_solve(Paso_SystemMatrix* A, double* out, double* in, Paso_Options* options);
94     void Paso_solve_free(Paso_SystemMatrix* in);
95 gross 1639 void Paso_SystemMatrix_startCollect(Paso_SystemMatrix* A,const double* in);
96 ksteube 1312 double* Paso_SystemMatrix_finishCollect(Paso_SystemMatrix* A);
97 gross 1639 void Paso_SystemMatrix_startColCollect(Paso_SystemMatrix* A,const double* in);
98 gross 1552 double* Paso_SystemMatrix_finishColCollect(Paso_SystemMatrix* A);
99 gross 1639 void Paso_SystemMatrix_startRowCollect(Paso_SystemMatrix* A,const double* in);
100 gross 1552 double* Paso_SystemMatrix_finishRowCollect(Paso_SystemMatrix* A);
101 ksteube 1312 void Paso_SystemMatrix_nullifyRowsAndCols(Paso_SystemMatrix* A, double* mask_row, double* mask_col, double main_diagonal_value);
102     double* Paso_SystemMatrix_borrowNormalization(Paso_SystemMatrix* A);
103 gross 1407 dim_t Paso_SystemMatrix_getTotalNumRows(const Paso_SystemMatrix* A);
104     dim_t Paso_SystemMatrix_getTotalNumCols(const Paso_SystemMatrix*);
105 ksteube 1312 dim_t Paso_SystemMatrix_getGlobalNumRows(Paso_SystemMatrix*);
106     dim_t Paso_SystemMatrix_getGlobalNumCols(Paso_SystemMatrix*);
107 jgs 150
108     void Paso_SystemMatrix_saveMM(Paso_SystemMatrix *, char *);
109     void Paso_SystemMatrix_saveHB(Paso_SystemMatrix *, char *);
110     Paso_SystemMatrix* Paso_SystemMatrix_loadMM_toCSR(char *);
111 ksteube 1312 Paso_SystemMatrix* Paso_SystemMatrix_loadMM_toCSC(char *);
112 jgs 150 void Paso_SystemMatrix_setDefaults(Paso_Options*);
113 gross 1859 int Paso_SystemMatrix_getSystemMatrixTypeId(const index_t solver,const index_t preconditioner, const index_t package,const bool_t symmetry);
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