43 #ifndef IFPACK2_SPARSECONTAINER_DECL_HPP
44 #define IFPACK2_SPARSECONTAINER_DECL_HPP
49 #include "Ifpack2_Container.hpp"
51 #include "Tpetra_MultiVector.hpp"
52 #include "Tpetra_Map.hpp"
53 #include "Tpetra_RowMatrix.hpp"
54 #include "Tpetra_CrsMatrix.hpp"
55 #include "Teuchos_ParameterList.hpp"
58 #ifdef HAVE_IFPACK2_AMESOS2
59 #include "Ifpack2_Details_Amesos2Wrapper.hpp"
133 template<
typename MatrixType,
typename InverseType>
135 :
public ContainerImpl<MatrixType, typename InverseType::scalar_type>
147 using matrix_type = MatrixType;
153 using inverse_type = InverseType;
155 using typename Container<MatrixType>::SC;
156 using typename Container<MatrixType>::LO;
157 using typename Container<MatrixType>::GO;
158 using typename Container<MatrixType>::NO;
160 using typename Container<MatrixType>::mv_type;
161 using typename Container<MatrixType>::map_type;
162 using typename Container<MatrixType>::vector_type;
163 using typename Container<MatrixType>::import_type;
165 using InverseScalar =
typename InverseType::scalar_type;
166 using InverseLocalOrdinal =
typename InverseType::local_ordinal_type;
167 using InverseGlobalOrdinal =
typename InverseType::global_ordinal_type;
168 using InverseNode =
typename InverseType::node_type;
170 using inverse_mv_type = Tpetra::MultiVector<InverseScalar, InverseLocalOrdinal, InverseGlobalOrdinal, InverseNode>;
171 using InverseCrs = Tpetra::CrsMatrix<InverseScalar, InverseLocalOrdinal, InverseGlobalOrdinal, InverseNode>;
172 using InverseMap =
typename Tpetra::Map<InverseLocalOrdinal, InverseGlobalOrdinal, InverseNode>;
175 using HostViewInverse =
typename inverse_mv_type::dual_view_type::t_host;
177 static_assert(std::is_same<MatrixType,
178 Tpetra::RowMatrix<SC, LO, GO, NO>>::value,
"Ifpack2::SparseContainer: Please use MatrixType = Tpetra::RowMatrix.");
188 using typename Container<MatrixType>::row_matrix_type;
206 const Teuchos::Array<Teuchos::Array<LO> >& partitions,
207 const Teuchos::RCP<const import_type>& importer,
218 virtual void setParameters(
const Teuchos::ParameterList& List);
240 Teuchos::ETransp mode = Teuchos::NO_TRANS,
241 SC alpha = Teuchos::ScalarTraits<SC>::one(),
242 SC beta = Teuchos::ScalarTraits<SC>::zero())
const;
250 Teuchos::ETransp mode = Teuchos::NO_TRANS,
251 SC alpha = Teuchos::ScalarTraits<SC>::one(),
252 SC beta = Teuchos::ScalarTraits<SC>::zero())
const;
261 virtual std::ostream&
print(std::ostream& os)
const;
272 describe (Teuchos::FancyOStream &out,
273 const Teuchos::EVerbosityLevel verbLevel =
274 Teuchos::Describable::verbLevel_default)
const;
300 solveBlockMV(inverse_mv_type& X,
303 Teuchos::ETransp mode,
305 InverseScalar beta)
const;
308 std::vector<Teuchos::RCP<InverseCrs>> diagBlocks_;
311 mutable std::vector<inverse_mv_type> invX;
313 mutable std::vector<inverse_mv_type> invY;
322 mutable Teuchos::Array<Teuchos::RCP<InverseType>> Inverses_;
324 Teuchos::RCP<Teuchos::Comm<int>> localComm_;
328 Teuchos::ParameterList List_;
333 #endif // IFPACK2_SPARSECONTAINER_HPP