/[escript]/trunk/paso/src/SystemMatrix_rowSum.cpp
ViewVC logotype

Diff of /trunk/paso/src/SystemMatrix_rowSum.cpp

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

revision 4828 by caltinay, Mon Mar 24 05:42:42 2014 UTC revision 4829 by caltinay, Thu Apr 3 04:02:53 2014 UTC
# Line 15  Line 15 
15  *****************************************************************************/  *****************************************************************************/
16    
17    
18  /************************************************************************************/  /****************************************************************************/
19    
20  /* Paso: SystemMatrix: calculates row sum                     */  /* Paso: SystemMatrix: calculates row sum                     */
21    
22    /****************************************************************************/
 /************************************************************************************/  
23    
24  /* Author: l.gross@auq.edu.au */  /* Author: l.gross@auq.edu.au */
25    
26  /************************************************************************************/  /****************************************************************************/
27    
28  #include "Paso.h"  #include "Paso.h"
29  #include "SystemMatrix.h"  #include "SystemMatrix.h"
30    
31  void Paso_SystemMatrix_rowSum(Paso_SystemMatrix* A, double* row_sum) {  void Paso_SystemMatrix_rowSum(Paso_SystemMatrix* A, double* row_sum)
32     dim_t irow, nrow;  {
33     if ((A->type & MATRIX_FORMAT_CSC) || (A->type & MATRIX_FORMAT_OFFSET1)) {      dim_t irow, nrow;
34          Esys_setError(TYPE_ERROR,"Paso_SystemMatrix_rowSum: No normalization available for compressed sparse column or index offset 1.");      if ((A->type & MATRIX_FORMAT_CSC) || (A->type & MATRIX_FORMAT_OFFSET1)) {
35        } else {          Esys_setError(TYPE_ERROR, "Paso_SystemMatrix_rowSum: No normalization available for compressed sparse column or index offset 1.");
36           nrow=A->mainBlock->numRows*A->row_block_size;      } else {
37           #pragma omp parallel for private(irow) schedule(static)          nrow=A->mainBlock->numRows*A->row_block_size;
38           for (irow=0; irow<nrow ; ++irow) {          #pragma omp parallel for private(irow) schedule(static)
39                 row_sum[irow]=0.;          for (irow=0; irow<nrow ; ++irow) {
40           }              row_sum[irow]=0.;
41           paso::SparseMatrix_addRow_CSR_OFFSET0(A->mainBlock,row_sum);          }
42           paso::SparseMatrix_addRow_CSR_OFFSET0(A->col_coupleBlock,row_sum);          A->mainBlock->addRow_CSR_OFFSET0(row_sum);
43     }          A->col_coupleBlock->addRow_CSR_OFFSET0(row_sum);
44        }
45  }  }
46    

Legend:
Removed from v.4828  
changed lines
  Added in v.4829

  ViewVC Help
Powered by ViewVC 1.1.26