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"
24 #include <type_traits>
41 template<
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> >
55 template<
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> >
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;
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,
205 std::string description ()
const;
271 applyImpl (
const MV& X,
290 double initializeTime_;
296 mutable double applyTime_;
305 mutable int numApply_;
316 template<
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> >
334 typedef MatrixType matrix_type;
337 typedef typename MatrixType::scalar_type scalar_type;
340 typedef typename MatrixType::local_ordinal_type local_ordinal_type;
343 typedef typename MatrixType::global_ordinal_type global_ordinal_type;
346 typedef typename MatrixType::node_type node_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;
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,
461 std::string description ()
const;
476 typedef Tpetra::MultiVector<scalar_type, local_ordinal_type,
477 global_ordinal_type, node_type> MV;
483 #endif // IFPACK2_DETAILS_TRIDISOLVER_DECL_HPP
virtual Teuchos::RCP< const Tpetra::Map< MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type > > getDomainMap() const =0
The domain Map of this operator.
Mix-in interface for preconditioners that can change their matrix after construction.
Definition: Ifpack2_Details_CanChangeMatrix.hpp:60
virtual int getNumApply() const =0
The number of calls to apply().
virtual Teuchos::RCP< const Tpetra::RowMatrix< MatrixType::scalar_type, MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type > > getMatrix() const =0
The input matrix given to the constructor.
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
"Preconditioner" that uses LAPACK's tridi LU.
Definition: Ifpack2_Details_TriDiSolver_decl.hpp:43
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< MatrixType::scalar_type >::magnitudeType magnitude_type
The type of the magnitude (absolute value) of a matrix entry.
Definition: Ifpack2_Preconditioner.hpp:78
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
MatrixType::scalar_type scalar_type
The type of entries in the input (global) matrix.
Definition: Ifpack2_Details_TriDiSolver_decl.hpp:76
virtual void compute()=0
Set up the numerical values in this preconditioner.
virtual Teuchos::RCP< const Tpetra::Map< MatrixType::local_ordinal_type, MatrixType::global_ordinal_type, MatrixType::node_type > > getRangeMap() const =0
The range Map of this operator.
MatrixType matrix_type
The first template parameter of this class.
Definition: Ifpack2_Details_TriDiSolver_decl.hpp:73
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
virtual int getNumCompute() const =0
The number of calls to compute().
Interface for all Ifpack2 preconditioners.
Definition: Ifpack2_Preconditioner.hpp:74
virtual double getInitializeTime() const =0
The time (in seconds) spent in initialize().
virtual void initialize()=0
Set up the graph structure of this preconditioner.
Declaration of interface for preconditioners that can change their matrix after construction.
static const EVerbosityLevel verbLevel_default
virtual bool isComputed() const =0
True if the preconditioner has been successfully computed, else false.
virtual int getNumInitialize() const =0
The number of calls to initialize().
virtual void setParameters(const Teuchos::ParameterList &List)=0
Set this preconditioner's parameters.
virtual double getComputeTime() const =0
The time (in seconds) spent in compute().
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_typealpha=Teuchos::ScalarTraits< MatrixType::scalar_type >::one(), MatrixType::scalar_typebeta=Teuchos::ScalarTraits< MatrixType::scalar_type >::zero()) const =0
Apply the preconditioner to X, putting the result in Y.
virtual bool isInitialized() const =0
True if the preconditioner has been successfully initialized, else false.
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
virtual double getApplyTime() const =0
The time (in seconds) spent in apply().
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
Set the new matrix.