10#ifndef IFPACK2_DETAILS_TRIDISOLVER_DECL_HPP
11#define IFPACK2_DETAILS_TRIDISOLVER_DECL_HPP
16#include "Ifpack2_ConfigDefs.hpp"
19#include "Ifpack2_Details_LapackSupportsScalar.hpp"
20#include "Tpetra_RowMatrix.hpp"
21#include "Tpetra_Import_fwd.hpp"
22#include "Tpetra_Export_fwd.hpp"
23#include "Teuchos_SerialTriDiMatrix.hpp"
41template<
class MatrixType,
42 const bool stub = ! LapackSupportsScalar<typename MatrixType::scalar_type>::value>
45 typename MatrixType::local_ordinal_type,
46 typename MatrixType::global_ordinal_type,
47 typename MatrixType::node_type>,
49 typename MatrixType::local_ordinal_type,
50 typename MatrixType::global_ordinal_type,
51 typename MatrixType::node_type> >
55template<
class MatrixType>
58 typename MatrixType::local_ordinal_type,
59 typename MatrixType::global_ordinal_type,
60 typename MatrixType::node_type>,
62 typename MatrixType::local_ordinal_type,
63 typename MatrixType::global_ordinal_type,
64 typename MatrixType::node_type> >
88 typedef typename Teuchos::ScalarTraits<scalar_type>::magnitudeType
magnitude_type;
91 typedef Tpetra::RowMatrix<scalar_type, local_ordinal_type, global_ordinal_type, node_type>
row_matrix_type;
93 static_assert(std::is_same<MatrixType, row_matrix_type>::value,
"Ifpack2::Details::TriDiSolver: The template parameter MatrixType must be a Tpetra::RowMatrix specialization. Please don't use Tpetra::CrsMatrix (a subclass of Tpetra::RowMatrix) here anymore. The constructor can take either a RowMatrix or a CrsMatrix just fine.");
95 typedef typename row_matrix_type::nonconst_global_inds_host_view_type nonconst_global_inds_host_view_type;
96 typedef typename row_matrix_type::nonconst_local_inds_host_view_type nonconst_local_inds_host_view_type;
97 typedef typename row_matrix_type::nonconst_values_host_view_type nonconst_values_host_view_type;
100 typedef Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type>
map_type;
109 TriDiSolver (
const Teuchos::RCP<const row_matrix_type>& matrix);
137 apply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
138 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
139 Teuchos::ETransp mode = Teuchos::NO_TRANS,
140 scalar_type alpha = Teuchos::ScalarTraits<scalar_type>::one(),
141 scalar_type beta = Teuchos::ScalarTraits<scalar_type>::zero())
const;
177 Teuchos::RCP<const row_matrix_type>
getMatrix ()
const;
180 void setMatrix (
const Teuchos::RCP<const row_matrix_type>& A);
209 describe (Teuchos::FancyOStream &out,
210 const Teuchos::EVerbosityLevel verbLevel =
211 Teuchos::Describable::verbLevel_default)
const;
217 describeLocal (Teuchos::FancyOStream& out,
218 const Teuchos::EVerbosityLevel verbLevel)
const;
231 extract (Teuchos::SerialTriDiMatrix<int, scalar_type>& A_local_tridi,
244 factor (Teuchos::SerialTriDiMatrix<int, scalar_type>& A,
245 const Teuchos::ArrayView<int>& ipiv);
260 typedef Teuchos::ScalarTraits<scalar_type> STS;
271 applyImpl (
const MV& X,
273 const Teuchos::ETransp mode,
278 Teuchos::RCP<const row_matrix_type> A_;
281 Teuchos::RCP<const row_matrix_type> A_local_;
284 Teuchos::SerialTriDiMatrix<int, scalar_type> A_local_tridi_;
287 Teuchos::Array<int> ipiv_;
290 double initializeTime_;
296 mutable double applyTime_;
305 mutable int numApply_;
316template<
class MatrixType>
319 typename MatrixType::local_ordinal_type,
320 typename MatrixType::global_ordinal_type,
321 typename MatrixType::node_type>,
323 typename MatrixType::local_ordinal_type,
324 typename MatrixType::global_ordinal_type,
325 typename MatrixType::node_type> >
349 typedef typename Teuchos::ScalarTraits<scalar_type>::magnitudeType
magnitude_type;
352 typedef Tpetra::RowMatrix<scalar_type, local_ordinal_type, global_ordinal_type, node_type>
row_matrix_type;
354 static_assert(std::is_same<MatrixType, row_matrix_type>::value,
"Ifpack2::Details::TriDiSolver: The template parameter MatrixType must be a Tpetra::RowMatrix specialization. Please don't use Tpetra::CrsMatrix (a subclass of Tpetra::RowMatrix) here anymore. The constructor can take either a RowMatrix or a CrsMatrix just fine.");
357 typedef Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type>
map_type;
366 TriDiSolver (
const Teuchos::RCP<const row_matrix_type>& matrix);
393 apply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
394 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
395 Teuchos::ETransp mode = Teuchos::NO_TRANS,
396 scalar_type alpha = Teuchos::ScalarTraits<scalar_type>::one(),
397 scalar_type beta = Teuchos::ScalarTraits<scalar_type>::zero())
const;
433 Teuchos::RCP<const row_matrix_type>
getMatrix ()
const;
436 void setMatrix (
const Teuchos::RCP<const row_matrix_type>& A);
465 describe (Teuchos::FancyOStream &out,
466 const Teuchos::EVerbosityLevel verbLevel =
467 Teuchos::Describable::verbLevel_default)
const;
470 describeLocal (Teuchos::FancyOStream& out,
471 const Teuchos::EVerbosityLevel verbLevel)
const;
Declaration of interface for preconditioners that can change their matrix after construction.
Mix-in interface for preconditioners that can change their matrix after construction.
Definition Ifpack2_Details_CanChangeMatrix.hpp:60
virtual void setMatrix(const Teuchos::RCP< const Tpetra::RowMatrix< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type > > &A)=0
Tpetra::RowMatrix< scalar_type, local_ordinal_type, global_ordinal_type, node_type > row_matrix_type
Specialization of Tpetra::RowMatrix used by this class.
Definition Ifpack2_Details_TriDiSolver_decl.hpp:91
TriDiSolver(const Teuchos::RCP< const row_matrix_type > &matrix)
Constructor.
Definition Ifpack2_Details_TriDiSolver_def.hpp:37
MatrixType::global_ordinal_type global_ordinal_type
The type of global indices in the input (global) matrix.
Definition Ifpack2_Details_TriDiSolver_decl.hpp:82
Teuchos::ScalarTraits< scalar_type >::magnitudeType magnitude_type
The type of the absolute value (magnitude) of a scalar_type.
Definition Ifpack2_Details_TriDiSolver_decl.hpp:88
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to the given FancyOStream.
Definition Ifpack2_Details_TriDiSolver_def.hpp:532
MatrixType::node_type node_type
The Node type of the input (global) matrix.
Definition Ifpack2_Details_TriDiSolver_decl.hpp:85
MatrixType::local_ordinal_type local_ordinal_type
The type of local indices in the input (global) matrix.
Definition Ifpack2_Details_TriDiSolver_decl.hpp:79
std::string description() const
A one-line description of this object.
Definition Ifpack2_Details_TriDiSolver_def.hpp:468
MatrixType matrix_type
The first template parameter of this class.
Definition Ifpack2_Details_TriDiSolver_decl.hpp:73
MatrixType::scalar_type scalar_type
The type of entries in the input (global) matrix.
Definition Ifpack2_Details_TriDiSolver_decl.hpp:76
Tpetra::Map< local_ordinal_type, global_ordinal_type, node_type > map_type
Specialization of Tpetra::Map used by this class.
Definition Ifpack2_Details_TriDiSolver_decl.hpp:100
TriDiSolver(const Teuchos::RCP< const row_matrix_type > &matrix)
Constructor.
Definition Ifpack2_Details_TriDiSolver_def.hpp:638
MatrixType::scalar_type scalar_type
The type of entries in the input (global) matrix.
Definition Ifpack2_Details_TriDiSolver_decl.hpp:337
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print the object with some verbosity level to the given FancyOStream.
Definition Ifpack2_Details_TriDiSolver_def.hpp:776
Tpetra::RowMatrix< scalar_type, local_ordinal_type, global_ordinal_type, node_type > row_matrix_type
Specialization of Tpetra::RowMatrix used by this class.
Definition Ifpack2_Details_TriDiSolver_decl.hpp:352
MatrixType matrix_type
The first template parameter of this class.
Definition Ifpack2_Details_TriDiSolver_decl.hpp:334
MatrixType::node_type node_type
The Node type of the input (global) matrix.
Definition Ifpack2_Details_TriDiSolver_decl.hpp:346
MatrixType::global_ordinal_type global_ordinal_type
The type of global indices in the input (global) matrix.
Definition Ifpack2_Details_TriDiSolver_decl.hpp:343
MatrixType::local_ordinal_type local_ordinal_type
The type of local indices in the input (global) matrix.
Definition Ifpack2_Details_TriDiSolver_decl.hpp:340
Teuchos::ScalarTraits< scalar_type >::magnitudeType magnitude_type
The type of the absolute value (magnitude) of a scalar_type.
Definition Ifpack2_Details_TriDiSolver_decl.hpp:349
std::string description() const
A one-line description of this object.
Definition Ifpack2_Details_TriDiSolver_def.hpp:769
Tpetra::Map< local_ordinal_type, global_ordinal_type, node_type > map_type
Specialization of Tpetra::Map used by this class.
Definition Ifpack2_Details_TriDiSolver_decl.hpp:357
"Preconditioner" that uses LAPACK's tridi LU.
Definition Ifpack2_Details_TriDiSolver_decl.hpp:52
Interface for all Ifpack2 preconditioners.
Definition Ifpack2_Preconditioner.hpp:75
virtual double getComputeTime() const=0
virtual bool isInitialized() const=0
virtual int getNumCompute() const=0
virtual Teuchos::RCP< const Tpetra::RowMatrix< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type > > getMatrix() const=0
virtual int getNumApply() const=0
virtual double getApplyTime() const=0
virtual void setParameters(const Teuchos::ParameterList &List)=0
virtual void apply(const Tpetra::MultiVector< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type > &X, Tpetra::MultiVector< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, MatrixType::scalar_type alpha=Teuchos::ScalarTraits< MatrixType::scalar_type >::one(), MatrixType::scalar_type beta=Teuchos::ScalarTraits< MatrixType::scalar_type >::zero()) const=0
virtual Teuchos::RCP< const Tpetra::Map< MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type > > getRangeMap() const=0
virtual Teuchos::RCP< const Tpetra::Map< MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type > > getDomainMap() const=0
virtual bool isComputed() const=0
virtual void initialize()=0
virtual double getInitializeTime() const=0
virtual int getNumInitialize() const=0
Preconditioners and smoothers for Tpetra sparse matrices.
Definition Ifpack2_AdditiveSchwarz_decl.hpp:41