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

Contents of /trunk-mpi-branch/paso/src/SystemMatrix_nullifyRowsAndCols.c

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1259 - (show annotations)
Mon Aug 20 06:30:26 2007 UTC (11 years, 8 months ago) by gross
File MIME type: text/plain
File size: 4371 byte(s)
the solver seems to work now but simplesolve has still some problems
1 /* $Id$ */
2
3 /*
4 ********************************************************************************
5 * Copyright 2006 by ACcESS MNRF *
6 * *
7 * http://www.access.edu.au *
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
14 /**************************************************************/
15
16 /* Paso: SystemMatrix */
17
18 /* nullify rows and columns in the matrix */
19
20 /* the rows and columns are marked by positive values in */
21 /* mask_row and mask_col. Values on the main diagonal */
22 /* which are marked to set to zero by both mask_row and */
23 /* mask_col are set to main_diagonal_value */
24
25
26 /**************************************************************/
27
28 /* Copyrights by ACcESS Australia 2003 */
29 /* Author: gross@access.edu.au */
30
31 /**************************************************************/
32
33 #include "Paso.h"
34 #include "SystemMatrix.h"
35
36 void Paso_SystemMatrix_nullifyRowsAndCols(Paso_SystemMatrix* A, double* mask_row, double* mask_col, double main_diagonal_value) {
37
38 double *remote_values=NULL;
39 Paso_MPIInfo *mpi_info=A->mpi_info;
40 if (mpi_info->size>1) {
41 if (A ->col_block_size==1 && A ->row_block_size ==1) {
42 if (A->type & MATRIX_FORMAT_CSC) {
43 Paso_setError(SYSTEM_ERROR,"Paso_SystemMatrix_nullifyRowsAndCols: CSC is not supported by MPI.");
44 return;
45 } else if (A->type & MATRIX_FORMAT_TRILINOS_CRS) {
46 Paso_setError(SYSTEM_ERROR,"Paso_SystemMatrix_nullifyRowsAndCols: TRILINOS is not supported with MPI.");
47 return;
48 } else {
49 Paso_SystemMatrix_allocBuffer(A);
50 if (Paso_noError()) {
51 Paso_SystemMatrix_startCollect(A,mask_col) ;
52 Paso_SparseMatrix_nullifyRowsAndCols_CSR_BLK1(A->mainBlock,mask_row,mask_col,main_diagonal_value);
53 remote_values=Paso_SystemMatrix_finishCollect(A);
54 Paso_SparseMatrix_nullifyRowsAndCols_CSR_BLK1(A->coupleBlock,mask_row,remote_values,0.);
55 }
56 Paso_SystemMatrix_freeBuffer(A);
57 }
58 } else {
59 if (A->type & MATRIX_FORMAT_CSC) {
60 Paso_setError(SYSTEM_ERROR,"Paso_SystemMatrix_nullifyRowsAndCols: CSC is not supported by MPI.");
61 return;
62 } else if (A->type & MATRIX_FORMAT_TRILINOS_CRS) {
63 Paso_setError(SYSTEM_ERROR,"Paso_SystemMatrix_nullifyRowsAndCols: TRILINOS is not supported with MPI.");
64 return;
65 } else {
66 Paso_SystemMatrix_allocBuffer(A);
67 if (Paso_noError()) {
68 Paso_SystemMatrix_startCollect(A,mask_col) ;
69 Paso_SparseMatrix_nullifyRowsAndCols_CSR(A->mainBlock,mask_row,mask_col,main_diagonal_value);
70 remote_values=Paso_SystemMatrix_finishCollect(A);
71 Paso_SparseMatrix_nullifyRowsAndCols_CSR(A->coupleBlock,mask_row,remote_values,0.);
72 }
73 Paso_SystemMatrix_freeBuffer(A);
74 }
75 }
76 } else {
77 if (A ->col_block_size==1 && A ->row_block_size ==1) {
78 if (A->type & MATRIX_FORMAT_CSC) {
79 Paso_SparseMatrix_nullifyRowsAndCols_CSC_BLK1(A->mainBlock,mask_row,mask_col,main_diagonal_value);
80 } else if (A->type & MATRIX_FORMAT_TRILINOS_CRS) {
81 Paso_setError(SYSTEM_ERROR,"Paso_SystemMatrix_nullifyRowsAndCols: TRILINOS is not supported.");
82 } else {
83 Paso_SparseMatrix_nullifyRowsAndCols_CSR_BLK1(A->mainBlock,mask_row,mask_col,main_diagonal_value);
84 }
85 } else {
86 if (A->type & MATRIX_FORMAT_CSC) {
87 Paso_SparseMatrix_nullifyRowsAndCols_CSC(A->mainBlock,mask_row,mask_col,main_diagonal_value);
88 } else if (A->type & MATRIX_FORMAT_TRILINOS_CRS) {
89 Paso_setError(SYSTEM_ERROR,"Paso_SystemMatrix_nullifyRowsAndCols: TRILINOS is not supported with MPI.");
90 } else {
91 Paso_SparseMatrix_nullifyRowsAndCols_CSR(A->mainBlock,mask_row,mask_col,main_diagonal_value);
92 }
93 }
94 }
95 return;
96 }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26