Debian Codegraph @

packages/muelu/research/caglusa/Xpetra_HierarchicalOperator_def.hpp

raw
1 // @HEADER
2 // *****************************************************************************
3 // MueLu: A package for multigrid based preconditioning
4 //
5 // Copyright 2012 NTESS and the MueLu contributors.
6 // SPDX-License-Identifier: BSD-3-Clause
7 // *****************************************************************************
8 // @HEADER
9
10 #ifndef XPETRA_HIERARCHICALOPERATOR_DEF_HPP
11 #define XPETRA_HIERARCHICALOPERATOR_DEF_HPP
12
13 namespace Xpetra {
14
15 template <class Scalar,
16 class LocalOrdinal,
17 class GlobalOrdinal,
18 class Node>
19 HierarchicalOperator<Scalar, LocalOrdinal, GlobalOrdinal, Node>::
20 HierarchicalOperator(const Teuchos::RCP<matrix_type>& nearField,
21 const Teuchos::RCP<blocked_matrix_type>& kernelApproximations,
22 const Teuchos::RCP<matrix_type>& basisMatrix,
23 std::vector<Teuchos::RCP<blocked_matrix_type> >& transferMatrices,
24 const Teuchos::RCP<Teuchos::ParameterList>& params) {
25 using Teuchos::RCP;
26 using Teuchos::rcp;
27 using TpCrs = TpetraCrsMatrix<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
28 using TpGOVec = TpetraMultiVector<GlobalOrdinal, LocalOrdinal, GlobalOrdinal, Node>;
29 using CrsWrap = CrsMatrixWrap<Scalar, LocalOrdinal, GlobalOrdinal, Node>;
30
31 std::vector<RCP<typename tHOp::blocked_matrix_type> > tTransferMatrices;
32 for (size_t i = 0; i < transferMatrices.size(); i++) {
33 auto transferT = transferMatrices[i]->getTpetra_BlockedMatrix();
34 tTransferMatrices.push_back(transferT);
35 }
36
37 op_ = rcp(new tHOp(Teuchos::rcp_dynamic_cast<TpCrs>(Teuchos::rcp_dynamic_cast<CrsWrap>(nearField)->getCrsMatrix(), true)->getTpetra_CrsMatrixNonConst(),
38 kernelApproximations->getTpetra_BlockedMatrix(),
39 Teuchos::rcp_dynamic_cast<TpCrs>(Teuchos::rcp_dynamic_cast<CrsWrap>(basisMatrix)->getCrsMatrix(), true)->getTpetra_CrsMatrixNonConst(),
40 tTransferMatrices,
41 params));
42 this->setTpetra_RowMatrix(op_);
43 }
44
45 } // namespace Xpetra
46
47 #endif // XPETRA_HIERARCHICALOPERATOR_DEF_HPP