42 #ifndef IFPACK2_BANDEDCONTAINER_DECL_HPP 43 #define IFPACK2_BANDEDCONTAINER_DECL_HPP 50 #include "Ifpack2_Details_LapackSupportsScalar.hpp" 51 #include "Tpetra_MultiVector.hpp" 52 #include "Tpetra_Map.hpp" 53 #include "Tpetra_RowMatrix.hpp" 54 #include "Teuchos_SerialDenseVector.hpp" 55 #include "Teuchos_SerialBandDenseMatrix.hpp" 104 template<
class MatrixType,
105 class LocalScalarType,
106 const bool supportsLocalScalarType =
112 template<
class MatrixType,
113 class LocalScalarType>
139 static_assert(std::is_same<MatrixType,
140 Tpetra::RowMatrix<
typename MatrixType::scalar_type,
141 typename MatrixType::local_ordinal_type,
142 typename MatrixType::global_ordinal_type,
143 typename MatrixType::node_type> >::value,
144 "Ifpack2::BandedContainer: Please use MatrixType = Tpetra::RowMatrix.");
154 typedef typename Container<MatrixType>::row_matrix_type
row_matrix_type;
177 const Teuchos::ArrayView<const local_ordinal_type>& localRows);
196 return IsInitialized_;
205 virtual void setParameters (
const Teuchos::ParameterList& List);
212 virtual void initialize ();
215 virtual void compute ();
219 apply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
220 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
221 Teuchos::ETransp mode=Teuchos::NO_TRANS,
222 scalar_type alpha=Teuchos::ScalarTraits<scalar_type>::one(),
223 scalar_type beta=Teuchos::ScalarTraits<scalar_type>::zero())
const;
227 weightedApply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
228 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
229 const Tpetra::Vector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& D,
230 Teuchos::ETransp mode=Teuchos::NO_TRANS,
231 scalar_type alpha=Teuchos::ScalarTraits<scalar_type>::one(),
232 scalar_type beta=Teuchos::ScalarTraits<scalar_type>::zero())
const;
241 virtual std::ostream& print (std::ostream& os)
const;
248 virtual std::string description ()
const;
252 describe (Teuchos::FancyOStream &out,
253 const Teuchos::EVerbosityLevel verbLevel =
254 Teuchos::Describable::verbLevel_default)
const;
262 void extract (
const Teuchos::RCP<const row_matrix_type>& globalMatrix);
269 typedef Tpetra::MultiVector<local_scalar_type, local_ordinal_type,
270 global_ordinal_type, node_type> local_mv_type;
281 applyImpl (
const local_mv_type& X,
283 Teuchos::ETransp mode,
284 const local_scalar_type alpha,
285 const local_scalar_type beta)
const;
291 Teuchos::RCP<Teuchos::SerialBandDenseMatrix<int, local_scalar_type> > diagBlock_;
294 Teuchos::Array<int> ipiv_;
297 Teuchos::RCP<const Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type> > localMap_;
300 mutable Teuchos::RCP<local_mv_type> Y_;
303 mutable Teuchos::RCP<local_mv_type> X_;
311 local_ordinal_type kl_;
312 local_ordinal_type ku_;
318 template<
class MatrixType,
class LocalScalarType>
344 static_assert(std::is_same<MatrixType,
345 Tpetra::RowMatrix<
typename MatrixType::scalar_type,
346 typename MatrixType::local_ordinal_type,
347 typename MatrixType::global_ordinal_type,
348 typename MatrixType::node_type> >::value,
349 "Ifpack2::BandedContainer: Please use MatrixType = Tpetra::RowMatrix.");
359 typedef typename Container<MatrixType>::row_matrix_type
row_matrix_type;
382 const Teuchos::ArrayView<const local_ordinal_type>& localRows);
401 return IsInitialized_;
410 virtual void setParameters (
const Teuchos::ParameterList& List);
417 virtual void initialize ();
420 virtual void compute ();
424 apply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
425 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
426 Teuchos::ETransp mode=Teuchos::NO_TRANS,
427 scalar_type alpha=Teuchos::ScalarTraits<scalar_type>::one(),
428 scalar_type beta=Teuchos::ScalarTraits<scalar_type>::zero())
const;
432 weightedApply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
433 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
434 const Tpetra::Vector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& D,
435 Teuchos::ETransp mode=Teuchos::NO_TRANS,
436 scalar_type alpha=Teuchos::ScalarTraits<scalar_type>::one(),
437 scalar_type beta=Teuchos::ScalarTraits<scalar_type>::zero())
const;
446 virtual std::ostream& print (std::ostream& os)
const;
453 virtual std::string description ()
const;
457 describe (Teuchos::FancyOStream &out,
458 const Teuchos::EVerbosityLevel verbLevel =
459 Teuchos::Describable::verbLevel_default)
const;
467 void extract (
const Teuchos::RCP<const row_matrix_type>& globalMatrix);
474 typedef Tpetra::MultiVector<local_scalar_type, local_ordinal_type,
475 global_ordinal_type, node_type> local_mv_type;
486 applyImpl (
const local_mv_type& X,
488 Teuchos::ETransp mode,
489 const local_scalar_type alpha,
490 const local_scalar_type beta)
const;
496 Teuchos::RCP<Teuchos::SerialBandDenseMatrix<int, local_scalar_type> > diagBlock_;
499 Teuchos::Array<int> ipiv_;
502 Teuchos::RCP<const Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type> > localMap_;
505 mutable Teuchos::RCP<local_mv_type> Y_;
508 mutable Teuchos::RCP<local_mv_type> X_;
516 local_ordinal_type kl_;
517 local_ordinal_type ku_;
523 #endif // IFPACK2_BANDEDCONTAINER_DECL_HPP MatrixType::scalar_type scalar_type
The type of entries in the input (global) matrix.
Definition: Ifpack2_BandedContainer_decl.hpp:131
Ifpack2::Container class declaration.
Container< MatrixType >::row_matrix_type row_matrix_type
The (base class) type of the input matrix.
Definition: Ifpack2_BandedContainer_decl.hpp:349
MatrixType::global_ordinal_type global_ordinal_type
The type of global indices in the input (global) matrix.
Definition: Ifpack2_BandedContainer_decl.hpp:340
Container< MatrixType >::row_matrix_type row_matrix_type
The (base class) type of the input matrix.
Definition: Ifpack2_BandedContainer_decl.hpp:144
MatrixType::node_type node_type
The Node type of the input (global) matrix.
Definition: Ifpack2_BandedContainer_decl.hpp:137
MatrixType::node_type node_type
The Node type of the input (global) matrix.
Definition: Ifpack2_BandedContainer_decl.hpp:342
LocalScalarType local_scalar_type
The second template parameter of this class.
Definition: Ifpack2_BandedContainer_decl.hpp:333
MatrixType::local_ordinal_type local_ordinal_type
The type of local indices in the input (global) matrix.
Definition: Ifpack2_BandedContainer_decl.hpp:133
Declaration and definition of the Ifpack2::Details::MultiVectorLocalGatherScatter class...
virtual size_t getNumRows() const
The number of rows in the local matrix on the calling process.
Definition: Ifpack2_BandedContainer_decl.hpp:395
virtual bool isComputed() const
Whether the container has been successfully computed.
Definition: Ifpack2_BandedContainer_decl.hpp:405
MatrixType::global_ordinal_type global_ordinal_type
The type of global indices in the input (global) matrix.
Definition: Ifpack2_BandedContainer_decl.hpp:135
virtual bool isComputed() const
Whether the container has been successfully computed.
Definition: Ifpack2_BandedContainer_decl.hpp:200
MatrixType::local_ordinal_type local_ordinal_type
The type of local indices in the input (global) matrix.
Definition: Ifpack2_BandedContainer_decl.hpp:338
virtual bool isInitialized() const
Whether the container has been successfully initialized.
Definition: Ifpack2_BandedContainer_decl.hpp:195
Interface for creating and solving a local linear problem.
Definition: Ifpack2_Container.hpp:103
LocalScalarType local_scalar_type
The second template parameter of this class.
Definition: Ifpack2_BandedContainer_decl.hpp:128
MatrixType matrix_type
The first template parameter of this class.
Definition: Ifpack2_BandedContainer_decl.hpp:126
Preconditioners and smoothers for Tpetra sparse matrices.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:72
MatrixType matrix_type
The first template parameter of this class.
Definition: Ifpack2_BandedContainer_decl.hpp:331
Type traits class that says whether Teuchos::LAPACK has a valid implementation for the given ScalarTy...
Definition: Ifpack2_Details_LapackSupportsScalar.hpp:17
Store and solve a local Banded linear problem.
Definition: Ifpack2_BandedContainer_decl.hpp:108
MatrixType::scalar_type scalar_type
The type of entries in the input (global) matrix.
Definition: Ifpack2_BandedContainer_decl.hpp:336
virtual bool isInitialized() const
Whether the container has been successfully initialized.
Definition: Ifpack2_BandedContainer_decl.hpp:400
virtual size_t getNumRows() const
The number of rows in the local matrix on the calling process.
Definition: Ifpack2_BandedContainer_decl.hpp:190