| 1 |
// @HEADER |
| 2 |
// ***************************************************************************** |
| 3 |
// ShyLU: Scalable Hybrid LU Preconditioner and Solver |
| 4 |
// |
| 5 |
// Copyright 2011 NTESS and the ShyLU contributors. |
| 6 |
// SPDX-License-Identifier: BSD-3-Clause |
| 7 |
// ***************************************************************************** |
| 8 |
// @HEADER |
| 9 |
|
| 10 |
#ifndef _FROSCH_EXTRACTSUBMATRICES_DECL_HPP |
| 11 |
#define _FROSCH_EXTRACTSUBMATRICES_DECL_HPP |
| 12 |
|
| 13 |
#include <ShyLU_DDFROSch_config.h> |
| 14 |
|
| 15 |
#include <FROSch_Timers.h> |
| 16 |
|
| 17 |
#include <Xpetra_MapFactory_fwd.hpp> |
| 18 |
#include <Xpetra_MatrixFactory_fwd.hpp> |
| 19 |
#include <Xpetra_ImportFactory_fwd.hpp> |
| 20 |
|
| 21 |
#include <KokkosKernels_Utils.hpp> |
| 22 |
|
| 23 |
namespace FROSch { |
| 24 |
|
| 25 |
using namespace std; |
| 26 |
using namespace Teuchos; |
| 27 |
using namespace Xpetra; |
| 28 |
|
| 29 |
template <class SC,class LO,class GO,class NO> |
| 30 |
RCP<const Matrix<SC,LO,GO,NO> > ExtractLocalSubdomainMatrix(RCP<const Matrix<SC,LO,GO,NO> > globalMatrix, |
| 31 |
RCP<const Map<LO,GO,NO> > map); |
| 32 |
|
| 33 |
// ----------------------------------------------------------- // |
| 34 |
// split ExtractLocalSubdomainMatrix into symbolic / compute |
| 35 |
template <class SC,class LO,class GO,class NO> |
| 36 |
void ExtractLocalSubdomainMatrix_Symbolic(RCP<Matrix<SC,LO,GO,NO> > subdomainMatrix, // input : globalMatrix, re-distributed with map |
| 37 |
RCP<Matrix<SC,LO,GO,NO> > localSubdomainMatrix); // output : local submatrix |
| 38 |
|
| 39 |
template <class SC,class LO,class GO,class NO> |
| 40 |
void ExtractLocalSubdomainMatrix_Compute(RCP<const Matrix<SC,LO,GO,NO> > globalMatrix, |
| 41 |
RCP< Matrix<SC,LO,GO,NO> > subdomainMatrix, |
| 42 |
RCP< Matrix<SC,LO,GO,NO> > repeatedMatrix); |
| 43 |
|
| 44 |
template <class SC,class LO,class GO,class NO> |
| 45 |
void ExtractLocalSubdomainMatrix_Compute(RCP< Import<LO,GO,NO> > scatter, |
| 46 |
RCP<const Matrix<SC,LO,GO,NO> > globalMatrix, |
| 47 |
RCP< Matrix<SC,LO,GO,NO> > subdomainMatrix, |
| 48 |
RCP< Matrix<SC,LO,GO,NO> > repeatedMatrix); |
| 49 |
// ----------------------------------------------------------- // |
| 50 |
|
| 51 |
template <class SC,class LO,class GO,class NO> |
| 52 |
RCP<const Matrix<SC,LO,GO,NO> > ExtractLocalSubdomainMatrix(RCP<const Matrix<SC,LO,GO,NO> > globalMatrix, |
| 53 |
RCP<const Map<LO,GO,NO> > map, |
| 54 |
SC value); |
| 55 |
|
| 56 |
template <class SC,class LO,class GO,class NO> |
| 57 |
int UpdateLocalSubdomainMatrix(RCP<Matrix<SC,LO,GO,NO> > globalMatrix, |
| 58 |
RCP<Map<LO,GO,NO> > &map, |
| 59 |
RCP<Matrix<SC,LO,GO,NO> > &localSubdomainMatrix); |
| 60 |
|
| 61 |
template <class SC,class LO,class GO,class NO> |
| 62 |
int BuildSubmatrices(RCP<const Matrix<SC,LO,GO,NO> > k, |
| 63 |
ArrayView<GO> indI, |
| 64 |
RCP<const Matrix<SC,LO,GO,NO> > &kII, |
| 65 |
RCP<const Matrix<SC,LO,GO,NO> > &kIJ, |
| 66 |
RCP<const Matrix<SC,LO,GO,NO> > &kJI, |
| 67 |
RCP<const Matrix<SC,LO,GO,NO> > &kJJ); |
| 68 |
|
| 69 |
template <class SC,class LO,class GO,class NO> |
| 70 |
int BuildSubmatrix(RCP<const Matrix<SC,LO,GO,NO> > k, |
| 71 |
ArrayView<GO> indI, |
| 72 |
RCP<const Matrix<SC,LO,GO,NO> > &kII); |
| 73 |
|
| 74 |
template <class LO,class GO,class NO> |
| 75 |
int BuildSubgraph(RCP<const CrsGraph<LO,GO,NO> > k, |
| 76 |
ArrayView<GO> indI, |
| 77 |
RCP<const CrsGraph<LO,GO,NO> > &kII); |
| 78 |
} |
| 79 |
|
| 80 |
#endif |