/[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 3368 by gross, Mon Oct 25 04:33:31 2010 UTC revision 3369 by gross, Fri Nov 19 06:26:11 2010 UTC
# Line 65  typedef struct Paso_SystemMatrix { Line 65  typedef struct Paso_SystemMatrix {
65    Paso_SparseMatrix* mainBlock;                      /* main block */    Paso_SparseMatrix* mainBlock;                      /* main block */
66    Paso_SparseMatrix* col_coupleBlock;                    /* coupling to naighbouring processors (row - col) */    Paso_SparseMatrix* col_coupleBlock;                    /* coupling to naighbouring processors (row - col) */
67    Paso_SparseMatrix* row_coupleBlock;                /* coupling to naighbouring processors (col - row)  */    Paso_SparseMatrix* row_coupleBlock;                /* coupling to naighbouring processors (col - row)  */
68    bool_t normalizer_is_valid;  
69    double *normalizer; /* vector with a inverse of the absolute row/col sum (set by Solver.c)*/    bool_t is_balanced;
70      double *balance_vector; /* matrix may be balanced by a diagonal matrix D=diagonal(balance_vector)
71                      if is_balanced is set, the matrix stored is D*A*D where A is the original matrix
72                          When the system of linear equations is solved we solve D*A*D*y=c.
73                          so to solve A*x=b one needs to set c=D*b and x=D*y. */
74    
75      
76      
77    index_t solver_package;  /* package controling the solver pointer */    index_t solver_package;  /* package controling the solver pointer */
78    void* solver_p;  /* pointer to data needed by a solver */    void* solver_p;  /* pointer to data needed by a solver */
79    
# Line 83  void Paso_SystemMatrix_free(Paso_SystemM Line 90  void Paso_SystemMatrix_free(Paso_SystemM
90    
91  void Paso_SystemMatrix_MatrixVector(const double alpha, Paso_SystemMatrix* A, const double* in, const double beta, double* out);  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);  void Paso_SystemMatrix_MatrixVector_CSR_OFFSET0(double alpha, Paso_SystemMatrix* A, const double* in, const double beta, double* out);
93    void Paso_SystemMatrix_nullifyRowsAndCols(Paso_SystemMatrix* A, double* mask_row, double* mask_col, double main_diagonal_value);
94    void Paso_SystemMatrix_applyBalanceInPlace(const Paso_SystemMatrix* A, double* x, const bool_t RHS);
95    void Paso_SystemMatrix_applyBalance(const Paso_SystemMatrix* A, double* x_out, const double* x, const bool_t RHS);
96    void Paso_SystemMatrix_balance(Paso_SystemMatrix* A);
97    
98  void Paso_solve(Paso_SystemMatrix* A, double* out, double* in, Paso_Options* options);  void Paso_solve(Paso_SystemMatrix* A, double* out, double* in, Paso_Options* options);
99  void Paso_solve_free(Paso_SystemMatrix* in);  void Paso_solve_free(Paso_SystemMatrix* in);
100  void  Paso_SystemMatrix_startCollect(Paso_SystemMatrix* A,const double* in);  void  Paso_SystemMatrix_startCollect(Paso_SystemMatrix* A,const double* in);
# Line 91  void  Paso_SystemMatrix_startColCollect( Line 103  void  Paso_SystemMatrix_startColCollect(
103  double* Paso_SystemMatrix_finishColCollect(Paso_SystemMatrix* A);  double* Paso_SystemMatrix_finishColCollect(Paso_SystemMatrix* A);
104  void  Paso_SystemMatrix_startRowCollect(Paso_SystemMatrix* A,const double* in);  void  Paso_SystemMatrix_startRowCollect(Paso_SystemMatrix* A,const double* in);
105  double* Paso_SystemMatrix_finishRowCollect(Paso_SystemMatrix* A);  double* Paso_SystemMatrix_finishRowCollect(Paso_SystemMatrix* A);
106  void Paso_SystemMatrix_nullifyRowsAndCols(Paso_SystemMatrix* A, double* mask_row, double* mask_col, double main_diagonal_value);  
 double* Paso_SystemMatrix_borrowNormalization(Paso_SystemMatrix* A);  
107  dim_t Paso_SystemMatrix_getTotalNumRows(const Paso_SystemMatrix* A);  dim_t Paso_SystemMatrix_getTotalNumRows(const Paso_SystemMatrix* A);
108  dim_t Paso_SystemMatrix_getTotalNumCols(const Paso_SystemMatrix*);  dim_t Paso_SystemMatrix_getTotalNumCols(const Paso_SystemMatrix*);
109  dim_t Paso_SystemMatrix_getGlobalNumRows(Paso_SystemMatrix*);  dim_t Paso_SystemMatrix_getGlobalNumRows(Paso_SystemMatrix*);
# Line 103  void Paso_SystemMatrix_saveHB(Paso_Syste Line 114  void Paso_SystemMatrix_saveHB(Paso_Syste
114  Paso_SystemMatrix* Paso_SystemMatrix_loadMM_toCSR(char *);  Paso_SystemMatrix* Paso_SystemMatrix_loadMM_toCSR(char *);
115  Paso_SystemMatrix* Paso_SystemMatrix_loadMM_toCSC(char *);  Paso_SystemMatrix* Paso_SystemMatrix_loadMM_toCSC(char *);
116  void Paso_RHS_loadMM_toCSR( char *fileName_p, double *b, dim_t size);  void Paso_RHS_loadMM_toCSR( char *fileName_p, double *b, dim_t size);
117  void Paso_SystemMatrix_setDefaults(Paso_Options*);  
118  int Paso_SystemMatrix_getSystemMatrixTypeId(const index_t solver,const index_t preconditioner, const  index_t package,const  bool_t symmetry, Esys_MPIInfo *mpi_info);  int Paso_SystemMatrix_getSystemMatrixTypeId(const index_t solver,const index_t preconditioner, const  index_t package,const  bool_t symmetry, Esys_MPIInfo *mpi_info);
119  dim_t Paso_SystemMatrix_getNumOutput(Paso_SystemMatrix* A);  dim_t Paso_SystemMatrix_getNumOutput(Paso_SystemMatrix* A);
120    
121  void Paso_SystemMatrix_setValues(Paso_SystemMatrix*,double);  void Paso_SystemMatrix_setValues(Paso_SystemMatrix*,double);
122  void Paso_SystemMatrix_add(Paso_SystemMatrix*,dim_t,index_t*, dim_t,dim_t,index_t*,dim_t, double*);  void Paso_SystemMatrix_add(Paso_SystemMatrix*,dim_t,index_t*, dim_t,dim_t,index_t*,dim_t, double*);
123  void Paso_SystemMatrix_rowSum(Paso_SystemMatrix* A, double* row_sum);  void Paso_SystemMatrix_rowSum(Paso_SystemMatrix* A, double* row_sum);
124  void Paso_SystemMatrix_nullifyRows(Paso_SystemMatrix* A, double* mask_row, double main_diagonal_value);  void Paso_SystemMatrix_nullifyRows(Paso_SystemMatrix* A, double* mask_row, double main_diagonal_value);
125    
126  void Paso_SystemMatrix_makeZeroRowSums(Paso_SystemMatrix * A_p, double* left_over);  void Paso_SystemMatrix_makeZeroRowSums(Paso_SystemMatrix * A_p, double* left_over);
127    
128  void Paso_SystemMatrix_copyBlockFromMainDiagonal(Paso_SystemMatrix * A_p, double* out);  void Paso_SystemMatrix_copyBlockFromMainDiagonal(Paso_SystemMatrix * A_p, double* out);
129  void Paso_SystemMatrix_copyBlockToMainDiagonal(Paso_SystemMatrix * A_p, const double* in);  void Paso_SystemMatrix_copyBlockToMainDiagonal(Paso_SystemMatrix * A_p, const double* in);
130  void Paso_SystemMatrix_copyFromMainDiagonal(Paso_SystemMatrix * A_p, double* out);  void Paso_SystemMatrix_copyFromMainDiagonal(Paso_SystemMatrix * A_p, double* out);

Legend:
Removed from v.3368  
changed lines
  Added in v.3369

  ViewVC Help
Powered by ViewVC 1.1.26