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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1417 - (hide annotations)
Mon Feb 25 04:45:48 2008 UTC (12 years, 1 month ago) by gross
File MIME type: text/plain
File size: 2508 byte(s)
some more work on the transport solver.
1 ksteube 1312
2 gross 1417 /* $Id:$ */
3 jgs 150
4 ksteube 1312 /*******************************************************
5     *
6 gross 1417 * Copyright 2008 by University of Queensland
7 ksteube 1312 *
8     * http://esscc.uq.edu.au
9     * Primary Business: Queensland, Australia
10     * Licensed under the Open Software License version 3.0
11     * http://www.opensource.org/licenses/osl-3.0.php
12     *
13     *******************************************************/
14 dhawcroft 631
15 jgs 150 /**************************************************************/
16    
17     /* Paso: SystemMatrix */
18    
19 gross 1417 /* nullify rows in the matrix */
20 jgs 150
21 gross 1417 /* the rows are marked by positive values in */
22     /* mask_row. Values on the main diagonal */
23     /* which are marked to set to zero by both mask_row */
24     /* are set to main_diagonal_value */
25 jgs 150
26    
27     /**************************************************************/
28    
29 gross 1417 /* Author: l.gross@uq.edu.au */
30 jgs 150
31     /**************************************************************/
32    
33     #include "Paso.h"
34     #include "SystemMatrix.h"
35    
36 gross 1417 void Paso_SystemMatrix_nullifyRows(Paso_SystemMatrix* A, double* mask_row, double main_diagonal_value) {
37 jgs 150
38 ksteube 1312 Paso_MPIInfo *mpi_info=A->mpi_info;
39 gross 1417 if (A ->col_block_size==1 && A ->row_block_size ==1) {
40 ksteube 1312 if (A->type & MATRIX_FORMAT_CSC) {
41 gross 1417 Paso_setError(SYSTEM_ERROR,"Paso_SystemMatrix_nullifyRows: CSC is not supported by MPI.");
42 ksteube 1312 return;
43     } else if (A->type & MATRIX_FORMAT_TRILINOS_CRS) {
44 gross 1417 Paso_setError(SYSTEM_ERROR,"Paso_SystemMatrix_nullifyRows: TRILINOS is not supported with MPI.");
45 ksteube 1312 return;
46     } else {
47     if (Paso_noError()) {
48 gross 1417 Paso_SparseMatrix_nullifyRows_CSR_BLK1(A->mainBlock,mask_row,main_diagonal_value);
49     Paso_SparseMatrix_nullifyRows_CSR_BLK1(A->coupleBlock,mask_row,0.);
50 ksteube 1312 }
51     }
52 gross 1417 } else {
53 ksteube 1312 if (A->type & MATRIX_FORMAT_CSC) {
54 gross 1417 Paso_setError(SYSTEM_ERROR,"Paso_SystemMatrix_nullifyRows: CSC is not supported by MPI.");
55 ksteube 1312 return;
56     } else if (A->type & MATRIX_FORMAT_TRILINOS_CRS) {
57 gross 1417 Paso_setError(SYSTEM_ERROR,"Paso_SystemMatrix_nullifyRows: TRILINOS is not supported with MPI.");
58 ksteube 1312 return;
59     } else {
60     Paso_SystemMatrix_allocBuffer(A);
61     if (Paso_noError()) {
62 gross 1417 Paso_SparseMatrix_nullifyRows_CSR(A->mainBlock,mask_row,main_diagonal_value);
63     Paso_SparseMatrix_nullifyRows_CSR(A->coupleBlock,mask_row,0.);
64 ksteube 1312 }
65     Paso_SystemMatrix_freeBuffer(A);
66     }
67 gross 1417 }
68 jgs 150 return;
69     }

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26