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

Diff of /trunk/paso/src/SystemMatrix_nullifyRows.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                                         */  /* Paso: SystemMatrix                                         */
21    
# Line 27  Line 27 
27  /*  are set to main_diagonal_value                            */  /*  are set to main_diagonal_value                            */
28    
29    
30  /************************************************************************************/  /****************************************************************************/
31    
32  /* Author: l.gross@uq.edu.au */  /* Author: l.gross@uq.edu.au */
33    
34  /************************************************************************************/  /****************************************************************************/
35    
36  #include "Paso.h"  #include "Paso.h"
37  #include "SystemMatrix.h"  #include "SystemMatrix.h"
38    
39  void Paso_SystemMatrix_nullifyRows(Paso_SystemMatrix* A, double* mask_row, double main_diagonal_value) {  void Paso_SystemMatrix_nullifyRows(Paso_SystemMatrix* A, double* mask_row,
40                                       double main_diagonal_value)
41    double* remote_values;  {
42    /*Esys_MPIInfo *mpi_info=A->mpi_info;*/      double* remote_values;
43    if (A ->col_block_size==1 && A ->row_block_size ==1) {      if (A->col_block_size==1 && A->row_block_size ==1) {
44         if (A->type & MATRIX_FORMAT_CSC) {         if (A->type & MATRIX_FORMAT_CSC) {
45             Esys_setError(SYSTEM_ERROR,"Paso_SystemMatrix_nullifyRows: CSC is not supported by MPI.");             Esys_setError(SYSTEM_ERROR,"Paso_SystemMatrix_nullifyRows: CSC is not supported by MPI.");
46             return;             return;
# Line 50  void Paso_SystemMatrix_nullifyRows(Paso_ Line 50  void Paso_SystemMatrix_nullifyRows(Paso_
50         } else {         } else {
51           if (Esys_noError()) {           if (Esys_noError()) {
52              Paso_SystemMatrix_startRowCollect(A,mask_row);              Paso_SystemMatrix_startRowCollect(A,mask_row);
53              paso::SparseMatrix_nullifyRows_CSR_BLK1(A->mainBlock,mask_row,main_diagonal_value);              A->mainBlock->nullifyRows_CSR_BLK1(mask_row, main_diagonal_value);
54              paso::SparseMatrix_nullifyRows_CSR_BLK1(A->col_coupleBlock,mask_row,0.);              A->col_coupleBlock->nullifyRows_CSR_BLK1(mask_row, 0.);
55              remote_values=Paso_SystemMatrix_finishRowCollect(A);              remote_values=Paso_SystemMatrix_finishRowCollect(A);
56              paso::SparseMatrix_nullifyRows_CSR_BLK1(A->row_coupleBlock,remote_values,0.);              A->row_coupleBlock->nullifyRows_CSR_BLK1(remote_values, 0.);
57           }           }
58         }         }
59    } else {    } else {
60         if (A->type & MATRIX_FORMAT_CSC) {         if (A->type & MATRIX_FORMAT_CSC) {
61             Esys_setError(SYSTEM_ERROR,"Paso_SystemMatrix_nullifyRows: CSC is not supported by MPI.");             Esys_setError(SYSTEM_ERROR,"Paso_SystemMatrix_nullifyRows: CSC is not supported by MPI.");
            return;  
62         } else if (A->type & MATRIX_FORMAT_TRILINOS_CRS) {         } else if (A->type & MATRIX_FORMAT_TRILINOS_CRS) {
63             Esys_setError(SYSTEM_ERROR,"Paso_SystemMatrix_nullifyRows: TRILINOS is not supported with MPI.");             Esys_setError(SYSTEM_ERROR,"Paso_SystemMatrix_nullifyRows: TRILINOS is not supported with MPI.");
            return;  
64         } else {         } else {
65           if (Esys_noError()) {              if (Esys_noError()) {
66              Paso_SystemMatrix_startRowCollect(A,mask_row);                  Paso_SystemMatrix_startRowCollect(A, mask_row);
67              paso::SparseMatrix_nullifyRows_CSR(A->mainBlock,mask_row,main_diagonal_value);                  A->mainBlock->nullifyRows_CSR(mask_row, main_diagonal_value);
68              paso::SparseMatrix_nullifyRows_CSR(A->col_coupleBlock,mask_row,0.);                  A->col_coupleBlock->nullifyRows_CSR(mask_row, 0.);
69              remote_values=Paso_SystemMatrix_finishRowCollect(A);                  remote_values=Paso_SystemMatrix_finishRowCollect(A);
70              paso::SparseMatrix_nullifyRows_CSR(A->row_coupleBlock,remote_values,0.);                  A->row_coupleBlock->nullifyRows_CSR(remote_values, 0.);
71           }              }
72         }         }
73    }      }
74  }  }
75    

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

  ViewVC Help
Powered by ViewVC 1.1.26