GEOSX
EpetraSuiteSparse.hpp
Go to the documentation of this file.
1 /*
2  * ------------------------------------------------------------------------------------------------------------
3  * SPDX-License-Identifier: LGPL-2.1-only
4  *
5  * Copyright (c) 2018-2020 Lawrence Livermore National Security LLC
6  * Copyright (c) 2018-2020 The Board of Trustees of the Leland Stanford Junior University
7  * Copyright (c) 2018-2020 Total, S.A
8  * Copyright (c) 2019- GEOSX Contributors
9  * All rights reserved
10  *
11  * See top level LICENSE, COPYRIGHT, CONTRIBUTORS, NOTICE, and ACKNOWLEDGEMENTS files for details.
12  * ------------------------------------------------------------------------------------------------------------
13  */
14 
19 #ifndef GEOSX_LINEARALGEBRA_INTERFACES_EPETRASUITESPARSE_HPP_
20 #define GEOSX_LINEARALGEBRA_INTERFACES_EPETRASUITESPARSE_HPP_
21 
22 #include "common/DataTypes.hpp"
25 
26 #include <Epetra_FECrsGraph.h>
27 
28 namespace geosx
29 {
30 
38 void ConvertEpetraToSuiteSparseMatrix( EpetraMatrix const & matrix,
39  SuiteSparse & SSData,
40  Epetra_Map * & serialMap,
41  Epetra_Import * & importToSerial );
42 
53 int SuiteSparseSolve( SuiteSparse & SSData,
54  Epetra_Map const * serialMap,
55  Epetra_Import const * importToSerial,
56  EpetraVector const & b,
57  EpetraVector & x,
58  bool transpose = false );
59 
68 real64 EpetraSuiteSparseCond( EpetraMatrix const & matrix,
69  Epetra_Map const * serialMap,
70  Epetra_Import const * importToSerial,
71  SuiteSparse & SSData );
72 
73 }
74 
75 #endif /*GEOSX_LINEARALGEBRA_INTERFACES_EPETRASUITESPARSE_HPP_*/
constexpr void transpose(DST_MATRIX &&LVARRAY_RESTRICT_REF dstMatrix, SRC_MATRIX const &LVARRAY_RESTRICT_REF srcMatrix)
Store the transpose of the NxM matrix srcMatrix in dstMatrix.
void ConvertEpetraToSuiteSparseMatrix(EpetraMatrix const &matrix, SuiteSparse &SSData, Epetra_Map *&serialMap, Epetra_Import *&importToSerial)
Converts a matrix from Epetra to SuiteSparse format.
double real64
64-bit floating point type.
Definition: DataTypes.hpp:136
real64 EpetraSuiteSparseCond(EpetraMatrix const &matrix, Epetra_Map const *serialMap, Epetra_Import const *importToSerial, SuiteSparse &SSData)
Computes an accurate condition number (time consuming function!!!)
int SuiteSparseSolve(SuiteSparse &SSData, HypreVector const &b, HypreVector &x, bool transpose=false)
Solves a linear system with SuiteSparse (matrix has already been factorized)