/[escript]/trunk/paso/src/SystemMatrix_nullifyRowsAndCols.c
ViewVC logotype

Diff of /trunk/paso/src/SystemMatrix_nullifyRowsAndCols.c

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

temp_trunk_copy/paso/src/SystemMatrix_nullifyRowsAndCols.c revision 1384 by phornby, Fri Jan 11 02:29:38 2008 UTC trunk/paso/src/SystemMatrix_nullifyRowsAndCols.c revision 1952 by jfenwick, Thu Oct 30 06:16:00 2008 UTC
# Line 1  Line 1 
1    
 /* $Id$ */  
   
2  /*******************************************************  /*******************************************************
3   *  *
4   *           Copyright 2003-2007 by ACceSS MNRF  * Copyright (c) 2003-2008 by University of Queensland
5   *       Copyright 2007 by University of Queensland  * Earth Systems Science Computational Center (ESSCC)
6   *  * http://www.uq.edu.au/esscc
7   *                http://esscc.uq.edu.au  *
8   *        Primary Business: Queensland, Australia  * Primary Business: Queensland, Australia
9   *  Licensed under the Open Software License version 3.0  * Licensed under the Open Software License version 3.0
10   *     http://www.opensource.org/licenses/osl-3.0.php  * http://www.opensource.org/licenses/osl-3.0.php
11   *  *
12   *******************************************************/  *******************************************************/
13    
14    
15  /**************************************************************/  /**************************************************************/
16    
17  /* Paso: SystemMatrix                                       */  /* Paso: SystemMatrix                                       */
18    
19  /*  nullify rows and columns in the matrix                    */  /*  nullify rows and columns in the matrix                    */
20    /*                                                            */
21  /*  the rows and columns are marked by positive values in     */  /*  the rows and columns are marked by positive values in     */
22  /*  mask_row and mask_col. Values on the main diagonal        */  /*  mask_row and mask_col. Values on the main diagonal        */
23  /*  which are marked to set to zero by both mask_row and      */  /*  which are marked to set to zero by both mask_row and      */
# Line 48  void Paso_SystemMatrix_nullifyRowsAndCol Line 47  void Paso_SystemMatrix_nullifyRowsAndCol
47             Paso_setError(SYSTEM_ERROR,"Paso_SystemMatrix_nullifyRowsAndCols: TRILINOS is not supported with MPI.");             Paso_setError(SYSTEM_ERROR,"Paso_SystemMatrix_nullifyRowsAndCols: TRILINOS is not supported with MPI.");
48             return;             return;
49         } else {         } else {
          Paso_SystemMatrix_allocBuffer(A);  
50           if (Paso_noError()) {           if (Paso_noError()) {
51              Paso_SystemMatrix_startCollect(A,mask_col) ;              Paso_SystemMatrix_startColCollect(A,mask_col);
52                Paso_SystemMatrix_startRowCollect(A,mask_row);
53              Paso_SparseMatrix_nullifyRowsAndCols_CSR_BLK1(A->mainBlock,mask_row,mask_col,main_diagonal_value);              Paso_SparseMatrix_nullifyRowsAndCols_CSR_BLK1(A->mainBlock,mask_row,mask_col,main_diagonal_value);
54              remote_values=Paso_SystemMatrix_finishCollect(A);              remote_values=Paso_SystemMatrix_finishColCollect(A);
55              Paso_SparseMatrix_nullifyRowsAndCols_CSR_BLK1(A->coupleBlock,mask_row,remote_values,0.);              Paso_SparseMatrix_nullifyRowsAndCols_CSR_BLK1(A->col_coupleBlock,mask_row,remote_values,0.);
56                remote_values=Paso_SystemMatrix_finishRowCollect(A);
57                Paso_SparseMatrix_nullifyRowsAndCols_CSR_BLK1(A->row_coupleBlock,remote_values,mask_col,0.);
58           }           }
          Paso_SystemMatrix_freeBuffer(A);  
59         }         }
60       } else {       } else {
61         if (A->type & MATRIX_FORMAT_CSC) {         if (A->type & MATRIX_FORMAT_CSC) {
# Line 65  void Paso_SystemMatrix_nullifyRowsAndCol Line 65  void Paso_SystemMatrix_nullifyRowsAndCol
65             Paso_setError(SYSTEM_ERROR,"Paso_SystemMatrix_nullifyRowsAndCols: TRILINOS is not supported with MPI.");             Paso_setError(SYSTEM_ERROR,"Paso_SystemMatrix_nullifyRowsAndCols: TRILINOS is not supported with MPI.");
66             return;             return;
67         } else {         } else {
          Paso_SystemMatrix_allocBuffer(A);  
68           if (Paso_noError()) {           if (Paso_noError()) {
69              Paso_SystemMatrix_startCollect(A,mask_col) ;              Paso_SystemMatrix_startColCollect(A,mask_col) ;
70                Paso_SystemMatrix_startRowCollect(A,mask_row) ;
71              Paso_SparseMatrix_nullifyRowsAndCols_CSR(A->mainBlock,mask_row,mask_col,main_diagonal_value);              Paso_SparseMatrix_nullifyRowsAndCols_CSR(A->mainBlock,mask_row,mask_col,main_diagonal_value);
72              remote_values=Paso_SystemMatrix_finishCollect(A);              remote_values=Paso_SystemMatrix_finishColCollect(A);
73              Paso_SparseMatrix_nullifyRowsAndCols_CSR(A->coupleBlock,mask_row,remote_values,0.);              Paso_SparseMatrix_nullifyRowsAndCols_CSR(A->col_coupleBlock,mask_row,remote_values,0.);
74                remote_values=Paso_SystemMatrix_finishRowCollect(A);
75                Paso_SparseMatrix_nullifyRowsAndCols_CSR(A->row_coupleBlock,remote_values,mask_col,0.);
76           }           }
          Paso_SystemMatrix_freeBuffer(A);  
77         }         }
78       }       }
79    } else {    } else {

Legend:
Removed from v.1384  
changed lines
  Added in v.1952

  ViewVC Help
Powered by ViewVC 1.1.26