/[escript]/branches/doubleplusgood/paso/src/SystemMatrix_nullifyRows.cpp
ViewVC logotype

Contents of /branches/doubleplusgood/paso/src/SystemMatrix_nullifyRows.cpp

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4261 - (show annotations)
Wed Feb 27 06:09:33 2013 UTC (6 years, 1 month ago) by jfenwick
File size: 3112 byte(s)
Initial all c++ build.
But ... there are now reinterpret_cast<>'s
1
2 /*****************************************************************************
3 *
4 * Copyright (c) 2003-2013 by University of Queensland
5 * http://www.uq.edu.au
6 *
7 * Primary Business: Queensland, Australia
8 * Licensed under the Open Software License version 3.0
9 * http://www.opensource.org/licenses/osl-3.0.php
10 *
11 * Development until 2012 by Earth Systems Science Computational Center (ESSCC)
12 * Development since 2012 by School of Earth Sciences
13 *
14 *****************************************************************************/
15
16
17 /************************************************************************************/
18
19 /* Paso: SystemMatrix */
20
21 /* nullify rows in the matrix */
22
23 /* The rows are marked by positive values in */
24 /* mask_row. Values on the main diagonal */
25 /* which are marked to set to zero by both mask_row */
26 /* are set to main_diagonal_value */
27
28
29 /************************************************************************************/
30
31 /* Author: l.gross@uq.edu.au */
32
33 /************************************************************************************/
34
35 #include "Paso.h"
36 #include "SystemMatrix.h"
37
38 void Paso_SystemMatrix_nullifyRows(Paso_SystemMatrix* A, double* mask_row, double main_diagonal_value) {
39
40 double* remote_values;
41 /*Esys_MPIInfo *mpi_info=A->mpi_info;*/
42 if (A ->col_block_size==1 && A ->row_block_size ==1) {
43 if (A->type & MATRIX_FORMAT_CSC) {
44 Esys_setError(SYSTEM_ERROR,"Paso_SystemMatrix_nullifyRows: CSC is not supported by MPI.");
45 return;
46 } else if (A->type & MATRIX_FORMAT_TRILINOS_CRS) {
47 Esys_setError(SYSTEM_ERROR,"Paso_SystemMatrix_nullifyRows: TRILINOS is not supported with MPI.");
48 return;
49 } else {
50 if (Esys_noError()) {
51 Paso_SystemMatrix_startRowCollect(A,mask_row);
52 Paso_SparseMatrix_nullifyRows_CSR_BLK1(A->mainBlock,mask_row,main_diagonal_value);
53 Paso_SparseMatrix_nullifyRows_CSR_BLK1(A->col_coupleBlock,mask_row,0.);
54 remote_values=Paso_SystemMatrix_finishRowCollect(A);
55 Paso_SparseMatrix_nullifyRows_CSR_BLK1(A->row_coupleBlock,remote_values,0.);
56 }
57 }
58 } else {
59 if (A->type & MATRIX_FORMAT_CSC) {
60 Esys_setError(SYSTEM_ERROR,"Paso_SystemMatrix_nullifyRows: CSC is not supported by MPI.");
61 return;
62 } else if (A->type & MATRIX_FORMAT_TRILINOS_CRS) {
63 Esys_setError(SYSTEM_ERROR,"Paso_SystemMatrix_nullifyRows: TRILINOS is not supported with MPI.");
64 return;
65 } else {
66 if (Esys_noError()) {
67 Paso_SystemMatrix_startRowCollect(A,mask_row);
68 Paso_SparseMatrix_nullifyRows_CSR(A->mainBlock,mask_row,main_diagonal_value);
69 Paso_SparseMatrix_nullifyRows_CSR(A->col_coupleBlock,mask_row,0.);
70 remote_values=Paso_SystemMatrix_finishRowCollect(A);
71 Paso_SparseMatrix_nullifyRows_CSR(A->row_coupleBlock,remote_values,0.);
72 }
73 }
74 }
75 }
76

Properties

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

  ViewVC Help
Powered by ViewVC 1.1.26