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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1562 - (show annotations)
Wed May 21 13:04:40 2008 UTC (11 years, 5 months ago) by gross
File MIME type: text/plain
File size: 4509 byte(s)
The algebraic upwinding with MPI. The case of boundary constraint needs still some attention. 


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

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26