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

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

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 790 by bcumming, Wed Jul 26 23:12:34 2006 UTC revision 1562 by gross, Wed May 21 13:04:40 2008 UTC
# Line 1  Line 1 
 /* $Id$ */  
1    
2    /* $Id$ */
3    
4  /*  /*******************************************************
5  ********************************************************************************   *
6  *               Copyright   2006 by ACcESS MNRF                                *   *           Copyright 2003-2007 by ACceSS MNRF
7  *                                                                              *   *       Copyright 2007 by University of Queensland
8  *                 http://www.access.edu.au                                     *   *
9  *           Primary Business: Queensland, Australia                            *   *                http://esscc.uq.edu.au
10  *     Licensed under the Open Software License version 3.0             *   *        Primary Business: Queensland, Australia
11  *        http://www.opensource.org/licenses/osl-3.0.php                        *   *  Licensed under the Open Software License version 3.0
12  ********************************************************************************   *     http://www.opensource.org/licenses/osl-3.0.php
13  */   *
14     *******************************************************/
15    
16  /**************************************************************/  /**************************************************************/
17    
# Line 23  Line 24 
24    
25  /**************************************************************/  /**************************************************************/
26    
27  #ifndef INC_PASO_SYSTEM  #ifndef INC_PASO_SYSTEMMATRIX
28  #define INC_PASO_SYSTEM  #define INC_PASO_SYSTEMMATRIX
29    
30  #include "Common.h"  #include "Common.h"
31    #include "SparseMatrix.h"
32  #include "SystemMatrixPattern.h"  #include "SystemMatrixPattern.h"
33  #include "Options.h"  #include "Options.h"
34    #include "Paso_MPI.h"
35    #include "Paso.h"
36    #include "Coupler.h"
37    
 //#include "CommBuffer.h"  
 //#include "Paso_MPI.h"  
38    
39  /**************************************************************/  /**************************************************************/
40    
# Line 42  Line 45 
45  #define MATRIX_FORMAT_SYM 2  #define MATRIX_FORMAT_SYM 2
46  #define MATRIX_FORMAT_BLK1 4  #define MATRIX_FORMAT_BLK1 4
47  #define MATRIX_FORMAT_OFFSET1 8  #define MATRIX_FORMAT_OFFSET1 8
48    #define MATRIX_FORMAT_TRILINOS_CRS 16
49    
50  typedef int Paso_SystemMatrixType;  typedef int Paso_SystemMatrixType;
51    
52  typedef struct Paso_SystemMatrix {  typedef struct Paso_SystemMatrix {
     /*  
 #ifdef PASO_MPI  
     Paso_CommBuffer *CommBuffer;  
     Paso_MPIInfo *MPIInfo;  
     dim_t numLocal;  
     dim_t numInternal;  
     dim_t numBoundary;  
     dim_t numExternal;  
     dim_t *vtxdist;  
 #endif  
     */  
53    Paso_SystemMatrixType type;    Paso_SystemMatrixType type;
54      Paso_SystemMatrixPattern *pattern;
55    
56    dim_t reference_counter;    dim_t reference_counter;
57    
58    dim_t logical_row_block_size;    dim_t logical_row_block_size;
# Line 68  typedef struct Paso_SystemMatrix { Line 63  typedef struct Paso_SystemMatrix {
63    dim_t col_block_size;    dim_t col_block_size;
64    dim_t block_size;    dim_t block_size;
65    
66    dim_t num_rows;    Paso_Distribution *row_distribution;
67    dim_t num_cols;    Paso_Distribution *col_distribution;
68      Paso_MPIInfo *mpi_info;
69    Paso_SystemMatrixPattern* pattern;  
70      Paso_Coupler* col_coupler;
71    dim_t len;    Paso_Coupler* row_coupler;
72    double *val;    /* this comes into play when PASO is used */
73      Paso_SparseMatrix* mainBlock;                      /* main block */
74    double *normalizer; /* vector with a inverse of the absolute row/col sum (set by Solver.c)*/    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    bool_t normalizer_is_valid;    bool_t normalizer_is_valid;
77      double *normalizer; /* vector with a inverse of the absolute row/col sum (set by Solver.c)*/
78    index_t solver_package;  /* package controling the solver pointer */    index_t solver_package;  /* package controling the solver pointer */
79    void* solver;  /* pointer to data needed by a solver */    void* solver;  /* pointer to data needed by a solver */
80    
81      /* this is only used for a trilinos matrix */
82      void *trilinos_data;
83    
84  } Paso_SystemMatrix;  } Paso_SystemMatrix;
85    
86  /*  interfaces: */  /*  interfaces: */
87    
88  Paso_SystemMatrix* Paso_SystemMatrix_alloc(Paso_SystemMatrixType,Paso_SystemMatrixPattern*,dim_t,dim_t);  Paso_SystemMatrix* Paso_SystemMatrix_alloc(Paso_SystemMatrixType,Paso_SystemMatrixPattern*,dim_t,dim_t);
89  Paso_SystemMatrix* Paso_SystemMatrix_reference(Paso_SystemMatrix*);  Paso_SystemMatrix* Paso_SystemMatrix_reference(Paso_SystemMatrix*);
90  void Paso_SystemMatrix_dealloc(Paso_SystemMatrix*);  void Paso_SystemMatrix_free(Paso_SystemMatrix*);
91    
 void Paso_SystemMatrix_setValues(Paso_SystemMatrix*,double);  
 void Paso_SystemMatrix_copy(Paso_SystemMatrix*,double*);  
 void Paso_SystemMatrix_add(Paso_SystemMatrix*,dim_t,index_t*, dim_t,dim_t,index_t*,dim_t, double*);  
92  void Paso_SystemMatrix_MatrixVector(double alpha, Paso_SystemMatrix* A, double* in, double beta, double* out);  void Paso_SystemMatrix_MatrixVector(double alpha, Paso_SystemMatrix* A, double* in, double beta, double* out);
 void Paso_SystemMatrix_MatrixVector_CSC_OFFSET0(double alpha, Paso_SystemMatrix* A, double* in, double beta, double* out);  
 void Paso_SystemMatrix_MatrixVector_CSC_OFFSET1(double alpha, Paso_SystemMatrix* A, double* in, double beta, double* out);  
93  void Paso_SystemMatrix_MatrixVector_CSR_OFFSET0(double alpha, Paso_SystemMatrix* A, double* in, double beta, double* out);  void Paso_SystemMatrix_MatrixVector_CSR_OFFSET0(double alpha, Paso_SystemMatrix* A, double* in, double beta, double* out);
94  void Paso_SystemMatrix_MatrixVector_CSR_OFFSET1(double alpha, Paso_SystemMatrix* A, double* in, double beta, double* out);  void Paso_solve(Paso_SystemMatrix* A, double* out, double* in, Paso_Options* options);
95    void Paso_solve_free(Paso_SystemMatrix* in);
96    void  Paso_SystemMatrix_startCollect(Paso_SystemMatrix* A,double* in);
97    double* Paso_SystemMatrix_finishCollect(Paso_SystemMatrix* A);
98    void  Paso_SystemMatrix_startColCollect(Paso_SystemMatrix* A,double* in);
99    double* Paso_SystemMatrix_finishColCollect(Paso_SystemMatrix* A);
100    void  Paso_SystemMatrix_startRowCollect(Paso_SystemMatrix* A,double* in);
101    double* Paso_SystemMatrix_finishRowCollect(Paso_SystemMatrix* A);
102    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    dim_t Paso_SystemMatrix_getTotalNumRows(const Paso_SystemMatrix* A);
105    dim_t Paso_SystemMatrix_getTotalNumCols(const Paso_SystemMatrix*);
106    dim_t Paso_SystemMatrix_getGlobalNumRows(Paso_SystemMatrix*);
107    dim_t Paso_SystemMatrix_getGlobalNumCols(Paso_SystemMatrix*);
108    
109  void Paso_SystemMatrix_saveMM(Paso_SystemMatrix *, char *);  void Paso_SystemMatrix_saveMM(Paso_SystemMatrix *, char *);
110  void Paso_SystemMatrix_saveHB(Paso_SystemMatrix *, char *);  void Paso_SystemMatrix_saveHB(Paso_SystemMatrix *, char *);
111  Paso_SystemMatrix* Paso_SystemMatrix_loadMM_toCSR(char *);  Paso_SystemMatrix* Paso_SystemMatrix_loadMM_toCSR(char *);
112  void Paso_SystemMatrix_nullifyRowsAndCols(Paso_SystemMatrix* A, double* mask_row, double* mask_col, double main_diagonal_value);  Paso_SystemMatrix* Paso_SystemMatrix_loadMM_toCSC(char *);
113  void Paso_SystemMatrix_setDefaults(Paso_Options*);  void Paso_SystemMatrix_setDefaults(Paso_Options*);
114  int Paso_SystemMatrix_getSystemMatrixTypeId(index_t solver, index_t package, bool_t symmetry);  int Paso_SystemMatrix_getSystemMatrixTypeId(index_t solver, index_t package, bool_t symmetry);
115  Paso_SystemMatrix* Paso_SystemMatrix_getSubmatrix(Paso_SystemMatrix* A,dim_t,index_t*,index_t*);  dim_t Paso_SystemMatrix_getNumOutput(Paso_SystemMatrix* A);
116  double* Paso_SystemMatrix_borrowNormalization(Paso_SystemMatrix* A);  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    void Paso_SystemMatrix_rowSum(Paso_SystemMatrix* A, double* row_sum);
119    void Paso_SystemMatrix_nullifyRows(Paso_SystemMatrix* A, double* mask_row, double main_diagonal_value);
120    void Paso_SparseMatrix_nullifyRows_CSR(Paso_SparseMatrix*, double*, double);
121    
 #endif /* #ifndef INC_PASO_SYSTEM */  
122    
123  /*  #endif /* #ifndef INC_PASO_SYSTEMMATRIX */
124   * $Log$  
  * Revision 1.2  2005/09/15 03:44:38  jgs  
  * Merge of development branch dev-02 back to main trunk on 2005-09-15  
  *  
  * Revision 1.1.2.2  2005/09/07 00:59:08  gross  
  * some inconsistent renaming fixed to make the linking work.  
  *  
  * Revision 1.1.2.1  2005/09/05 06:29:47  gross  
  * These files have been extracted from finley to define a stand alone libray for iterative  
  * linear solvers on the ALTIX. main entry through Paso_solve. this version compiles but  
  * has not been tested yet.  
  *  
  *  
  */  

Legend:
Removed from v.790  
changed lines
  Added in v.1562

  ViewVC Help
Powered by ViewVC 1.1.26