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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2608 - (hide annotations)
Tue Aug 18 01:25:18 2009 UTC (10 years, 1 month ago) by jfenwick
File MIME type: text/plain
File size: 4498 byte(s)
Updating Lutz' email

1 ksteube 1312
2     /*******************************************************
3 ksteube 1811 *
4 jfenwick 2548 * Copyright (c) 2003-2009 by University of Queensland
5 ksteube 1811 * Earth Systems Science Computational Center (ESSCC)
6     * http://www.uq.edu.au/esscc
7     *
8     * Primary Business: Queensland, Australia
9     * Licensed under the Open Software License version 3.0
10     * http://www.opensource.org/licenses/osl-3.0.php
11     *
12     *******************************************************/
13 dhawcroft 631
14 ksteube 1811
15 jgs 150 /**************************************************************/
16    
17     /* Paso: SystemMatrix */
18    
19     /* nullify rows and columns in the matrix */
20 jfenwick 1952 /* */
21 jgs 150 /* the rows and columns are marked by positive values in */
22     /* mask_row and mask_col. Values on the main diagonal */
23     /* which are marked to set to zero by both mask_row and */
24     /* mask_col are set to main_diagonal_value */
25    
26    
27     /**************************************************************/
28    
29     /* Copyrights by ACcESS Australia 2003 */
30 jfenwick 2608 /* Author: Lutz Gross, l.gross@uq.edu.au */
31 jgs 150
32     /**************************************************************/
33    
34     #include "Paso.h"
35     #include "SystemMatrix.h"
36    
37     void Paso_SystemMatrix_nullifyRowsAndCols(Paso_SystemMatrix* A, double* mask_row, double* mask_col, double main_diagonal_value) {
38    
39 ksteube 1312 double *remote_values=NULL;
40     Paso_MPIInfo *mpi_info=A->mpi_info;
41     if (mpi_info->size>1) {
42     if (A ->col_block_size==1 && A ->row_block_size ==1) {
43     if (A->type & MATRIX_FORMAT_CSC) {
44     Paso_setError(SYSTEM_ERROR,"Paso_SystemMatrix_nullifyRowsAndCols: CSC is not supported by MPI.");
45     return;
46     } else if (A->type & MATRIX_FORMAT_TRILINOS_CRS) {
47     Paso_setError(SYSTEM_ERROR,"Paso_SystemMatrix_nullifyRowsAndCols: TRILINOS is not supported with MPI.");
48     return;
49     } else {
50     if (Paso_noError()) {
51 gross 1552 Paso_SystemMatrix_startColCollect(A,mask_col);
52     Paso_SystemMatrix_startRowCollect(A,mask_row);
53 ksteube 1312 Paso_SparseMatrix_nullifyRowsAndCols_CSR_BLK1(A->mainBlock,mask_row,mask_col,main_diagonal_value);
54 gross 1552 remote_values=Paso_SystemMatrix_finishColCollect(A);
55     Paso_SparseMatrix_nullifyRowsAndCols_CSR_BLK1(A->col_coupleBlock,mask_row,remote_values,0.);
56 gross 1563 remote_values=Paso_SystemMatrix_finishRowCollect(A);
57 gross 1552 Paso_SparseMatrix_nullifyRowsAndCols_CSR_BLK1(A->row_coupleBlock,remote_values,mask_col,0.);
58 ksteube 1312 }
59     }
60     } else {
61     if (A->type & MATRIX_FORMAT_CSC) {
62     Paso_setError(SYSTEM_ERROR,"Paso_SystemMatrix_nullifyRowsAndCols: CSC is not supported by MPI.");
63     return;
64     } else if (A->type & MATRIX_FORMAT_TRILINOS_CRS) {
65     Paso_setError(SYSTEM_ERROR,"Paso_SystemMatrix_nullifyRowsAndCols: TRILINOS is not supported with MPI.");
66     return;
67     } else {
68     if (Paso_noError()) {
69 gross 1552 Paso_SystemMatrix_startColCollect(A,mask_col) ;
70     Paso_SystemMatrix_startRowCollect(A,mask_row) ;
71 ksteube 1312 Paso_SparseMatrix_nullifyRowsAndCols_CSR(A->mainBlock,mask_row,mask_col,main_diagonal_value);
72 gross 1552 remote_values=Paso_SystemMatrix_finishColCollect(A);
73     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 ksteube 1312 }
77     }
78     }
79     } else {
80     if (A ->col_block_size==1 && A ->row_block_size ==1) {
81     if (A->type & MATRIX_FORMAT_CSC) {
82     Paso_SparseMatrix_nullifyRowsAndCols_CSC_BLK1(A->mainBlock,mask_row,mask_col,main_diagonal_value);
83     } else if (A->type & MATRIX_FORMAT_TRILINOS_CRS) {
84     Paso_setError(SYSTEM_ERROR,"Paso_SystemMatrix_nullifyRowsAndCols: TRILINOS is not supported.");
85     } else {
86     Paso_SparseMatrix_nullifyRowsAndCols_CSR_BLK1(A->mainBlock,mask_row,mask_col,main_diagonal_value);
87     }
88     } else {
89     if (A->type & MATRIX_FORMAT_CSC) {
90     Paso_SparseMatrix_nullifyRowsAndCols_CSC(A->mainBlock,mask_row,mask_col,main_diagonal_value);
91     } else if (A->type & MATRIX_FORMAT_TRILINOS_CRS) {
92     Paso_setError(SYSTEM_ERROR,"Paso_SystemMatrix_nullifyRowsAndCols: TRILINOS is not supported with MPI.");
93     } else {
94     Paso_SparseMatrix_nullifyRowsAndCols_CSR(A->mainBlock,mask_row,mask_col,main_diagonal_value);
95     }
96     }
97 jgs 150 }
98     return;
99     }

Properties

Name Value
svn:eol-style native
svn:keywords Author Date Id Revision

  ViewVC Help
Powered by ViewVC 1.1.26