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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 790 - (show annotations)
Wed Jul 26 23:12:34 2006 UTC (13 years, 7 months ago) by bcumming
File MIME type: text/plain
File size: 4520 byte(s)
changes to escript/py_src/pdetools.py and /escript/src/Data.h/.cpp to
make the Locator work in MPI. escript::Data::mindp now returns a 3 tuple,
with the MPI rank of the process on which the minimum value occurs
included. escript::Data::convertToNumArrayFromDPNo also takes the ProcNo
to perform the MPI reduction.

This had to be implemented in both the MPI and non-MPI versions to allow
the necesary changes to the Python code in pdetools.py. In the non-MPI
version ProcNo is set to 0. This works for the explicit scripts tested
thus far, however if it causes problems in your scripts contact Ben or
Lutz, or revert the three files (pdetools.py, Data.h and Data.cpp) to
the previous version.  


1 /* $Id$ */
2
3
4 /*
5 ********************************************************************************
6 * Copyright 2006 by ACcESS MNRF *
7 * *
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 /**************************************************************/
16
17 /* Paso: SystemMatrix and SystemVector */
18
19 /**************************************************************/
20
21 /* Copyrights by ACcESS Australia 2003,2004,2005,2006 */
22 /* 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 //#include "CommBuffer.h"
34 //#include "Paso_MPI.h"
35
36 /**************************************************************/
37
38 /* this struct holds a stiffness matrix: */
39
40 #define MATRIX_FORMAT_DEFAULT 0
41 #define MATRIX_FORMAT_CSC 1
42 #define MATRIX_FORMAT_SYM 2
43 #define MATRIX_FORMAT_BLK1 4
44 #define MATRIX_FORMAT_OFFSET1 8
45
46 typedef int Paso_SystemMatrixType;
47
48 typedef struct Paso_SystemMatrix {
49 /*
50 #ifdef PASO_MPI
51 Paso_CommBuffer *CommBuffer;
52 Paso_MPIInfo *MPIInfo;
53 dim_t numLocal;
54 dim_t numInternal;
55 dim_t numBoundary;
56 dim_t numExternal;
57 dim_t *vtxdist;
58 #endif
59 */
60 Paso_SystemMatrixType type;
61 dim_t reference_counter;
62
63 dim_t logical_row_block_size;
64 dim_t logical_col_block_size;
65 dim_t logical_block_size;
66
67 dim_t row_block_size;
68 dim_t col_block_size;
69 dim_t block_size;
70
71 dim_t num_rows;
72 dim_t num_cols;
73
74 Paso_SystemMatrixPattern* pattern;
75
76 dim_t len;
77 double *val;
78
79 double *normalizer; /* vector with a inverse of the absolute row/col sum (set by Solver.c)*/
80 bool_t normalizer_is_valid;
81 index_t solver_package; /* package controling the solver pointer */
82 void* solver; /* pointer to data needed by a solver */
83
84 } 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 void Paso_SystemMatrix_dealloc(Paso_SystemMatrix*);
91
92 void Paso_SystemMatrix_setValues(Paso_SystemMatrix*,double);
93 void Paso_SystemMatrix_copy(Paso_SystemMatrix*,double*);
94 void Paso_SystemMatrix_add(Paso_SystemMatrix*,dim_t,index_t*, dim_t,dim_t,index_t*,dim_t, double*);
95 void Paso_SystemMatrix_MatrixVector(double alpha, Paso_SystemMatrix* A, double* in, double beta, double* out);
96 void Paso_SystemMatrix_MatrixVector_CSC_OFFSET0(double alpha, Paso_SystemMatrix* A, double* in, double beta, double* out);
97 void Paso_SystemMatrix_MatrixVector_CSC_OFFSET1(double alpha, Paso_SystemMatrix* A, double* in, double beta, double* out);
98 void Paso_SystemMatrix_MatrixVector_CSR_OFFSET0(double alpha, Paso_SystemMatrix* A, double* in, double beta, double* out);
99 void Paso_SystemMatrix_MatrixVector_CSR_OFFSET1(double alpha, Paso_SystemMatrix* A, double* in, double beta, double* out);
100
101 void Paso_SystemMatrix_saveMM(Paso_SystemMatrix *, char *);
102 void Paso_SystemMatrix_saveHB(Paso_SystemMatrix *, char *);
103 Paso_SystemMatrix* Paso_SystemMatrix_loadMM_toCSR(char *);
104 void Paso_SystemMatrix_nullifyRowsAndCols(Paso_SystemMatrix* A, double* mask_row, double* mask_col, double main_diagonal_value);
105 void Paso_SystemMatrix_setDefaults(Paso_Options*);
106 int Paso_SystemMatrix_getSystemMatrixTypeId(index_t solver, index_t package, bool_t symmetry);
107 Paso_SystemMatrix* Paso_SystemMatrix_getSubmatrix(Paso_SystemMatrix* A,dim_t,index_t*,index_t*);
108 double* Paso_SystemMatrix_borrowNormalization(Paso_SystemMatrix* A);
109
110 #endif /* #ifndef INC_PASO_SYSTEM */
111
112 /*
113 * $Log$
114 * Revision 1.2 2005/09/15 03:44:38 jgs
115 * Merge of development branch dev-02 back to main trunk on 2005-09-15
116 *
117 * Revision 1.1.2.2 2005/09/07 00:59:08 gross
118 * some inconsistent renaming fixed to make the linking work.
119 *
120 * Revision 1.1.2.1 2005/09/05 06:29:47 gross
121 * These files have been extracted from finley to define a stand alone libray for iterative
122 * linear solvers on the ALTIX. main entry through Paso_solve. this version compiles but
123 * has not been tested yet.
124 *
125 *
126 */

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26