|
Ifpack2 Templated Preconditioning Package
Version 1.0
|
43 #ifndef IFPACK2_LOCALSPARSETRIANGULARSOLVER_DECL_HPP
44 #define IFPACK2_LOCALSPARSETRIANGULARSOLVER_DECL_HPP
48 #include "Tpetra_CrsMatrix_fwd.hpp"
49 #include "Teuchos_FancyOStream.hpp"
50 #include <type_traits>
76 template<
class MatrixType>
79 typename MatrixType::local_ordinal_type,
80 typename MatrixType::global_ordinal_type,
81 typename MatrixType::node_type>,
83 typename MatrixType::local_ordinal_type,
84 typename MatrixType::global_ordinal_type,
85 typename MatrixType::node_type> >
100 typedef Tpetra::Map<local_ordinal_type, global_ordinal_type, node_type>
map_type;
108 static_assert (std::is_same<MatrixType, row_matrix_type>::value,
109 "Ifpack2::LocalSparseTriangularSolver: The template parameter "
110 "MatrixType must be a Tpetra::RowMatrix specialization. "
111 "Please don't use Tpetra::CrsMatrix (a subclass of "
112 "Tpetra::RowMatrix) here anymore. The constructor can take "
113 "either a RowMatrix or a CrsMatrix just fine.");
153 const Teuchos::RCP<Teuchos::FancyOStream>& out);
199 return isInitialized_;
232 apply (
const Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& X,
233 Tpetra::MultiVector<scalar_type,local_ordinal_type,global_ordinal_type,node_type>& Y,
234 Teuchos::ETransp mode = Teuchos::NO_TRANS,
235 scalar_type alpha = Teuchos::ScalarTraits<scalar_type>::one (),
236 scalar_type beta = Teuchos::ScalarTraits<scalar_type>::zero ())
const;
257 Teuchos::ETransp mode = Teuchos::NO_TRANS)
const;
260 Teuchos::RCP<const Teuchos::Comm<int> >
getComm ()
const;
263 Teuchos::RCP<const row_matrix_type>
getMatrix ()
const {
320 describe (Teuchos::FancyOStream& out,
321 const Teuchos::EVerbosityLevel verbLevel =
322 Teuchos::Describable::verbLevel_default)
const;
328 virtual void setMatrix (
const Teuchos::RCP<const row_matrix_type>& A);
334 Teuchos::RCP<const row_matrix_type> A_;
336 Teuchos::RCP<Teuchos::FancyOStream> out_;
338 Teuchos::RCP<const crs_matrix_type> A_crs_;
340 typedef Tpetra::MultiVector<scalar_type, local_ordinal_type, global_ordinal_type, node_type> MV;
341 mutable Teuchos::RCP<MV> X_colMap_;
342 mutable Teuchos::RCP<MV> Y_rowMap_;
355 bool isInternallyChanged_;
356 bool reverseStorage_;
358 mutable int numInitialize_;
359 mutable int numCompute_;
360 mutable int numApply_;
362 double initializeTime_;
368 Teuchos::RCP<HtsImpl> htsImpl_;
397 localApply (
const MV& X,
399 const Teuchos::ETransp mode,
405 localTriangularSolve (
const MV& Y,
407 const Teuchos::ETransp mode)
const;
409 void initializeState();
414 #endif // IFPACK2_LOCALSPARSETRIANGULARSOLVER_DECL_HPP
bool isInitialized() const
Return true if the preconditioner has been successfully initialized.
Definition: Ifpack2_LocalSparseTriangularSolver_decl.hpp:198
std::string description() const
A one-line description of this object.
Definition: Ifpack2_LocalSparseTriangularSolver_def.hpp:806
Teuchos::RCP< const Teuchos::Comm< int > > getComm() const
This operator's communicator.
Teuchos::RCP< const map_type > getRangeMap() const
The range of this operator.
Definition: Ifpack2_LocalSparseTriangularSolver_def.hpp:890
bool isComputed() const
Return true if compute() has been called.
Definition: Ifpack2_LocalSparseTriangularSolver_decl.hpp:209
MatrixType::scalar_type scalar_type
Type of the entries of the input matrix.
Definition: Ifpack2_LocalSparseTriangularSolver_decl.hpp:89
MatrixType::mag_type magnitude_type
Type of the absolute value (magnitude) of a scalar_type value.
Definition: Ifpack2_LocalSparseTriangularSolver_decl.hpp:98
Tpetra::CrsMatrix< scalar_type, local_ordinal_type, global_ordinal_type, node_type > crs_matrix_type
Specialization of Tpetra::CrsMatrix used by this class.
Definition: Ifpack2_LocalSparseTriangularSolver_decl.hpp:106
double getApplyTime() const
Return the time spent in apply().
Definition: Ifpack2_LocalSparseTriangularSolver_def.hpp:799
int getNumApply() const
Return the number of calls to apply().
Definition: Ifpack2_LocalSparseTriangularSolver_def.hpp:778
Teuchos::RCP< const map_type > getDomainMap() const
The domain of this operator.
Definition: Ifpack2_LocalSparseTriangularSolver_def.hpp:877
MatrixType::global_ordinal_type global_ordinal_type
Type of the global indices of the input matrix.
Definition: Ifpack2_LocalSparseTriangularSolver_decl.hpp:93
virtual void setMatrix(const Teuchos::RCP< const row_matrix_type > &A)
Set this preconditioner's matrix.
Definition: Ifpack2_LocalSparseTriangularSolver_def.hpp:902
void compute()
"Numeric" phase of setup
Definition: Ifpack2_LocalSparseTriangularSolver_def.hpp:503
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_LocalSparseTriangularSolver_decl.hpp:103
MatrixType::node_type node_type
Node type of the input matrix.
Definition: Ifpack2_LocalSparseTriangularSolver_decl.hpp:95
int getNumCompute() const
Return the number of calls to compute().
Definition: Ifpack2_LocalSparseTriangularSolver_def.hpp:771
int getNumInitialize() const
Return the number of calls to initialize().
Definition: Ifpack2_LocalSparseTriangularSolver_def.hpp:764
MatrixType::local_ordinal_type local_ordinal_type
Type of the local indices of the input matrix.
Definition: Ifpack2_LocalSparseTriangularSolver_decl.hpp:91
Interface for all Ifpack2 preconditioners.
Definition: Ifpack2_Preconditioner.hpp:107
double getComputeTime() const
Return the time spent in compute().
Definition: Ifpack2_LocalSparseTriangularSolver_def.hpp:792
Tpetra::Map< local_ordinal_type, global_ordinal_type, node_type > map_type
Specialization of Tpetra::Map used by this class.
Definition: Ifpack2_LocalSparseTriangularSolver_decl.hpp:100
Preconditioners and smoothers for Tpetra sparse matrices.
Definition: Ifpack2_AdditiveSchwarz_decl.hpp:72
void setParameters(const Teuchos::ParameterList ¶ms)
Set this object's parameters.
Definition: Ifpack2_LocalSparseTriangularSolver_def.hpp:319
void applyMat(const Tpetra::MultiVector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &X, Tpetra::MultiVector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS) const
Apply the original input matrix.
virtual ~LocalSparseTriangularSolver()
Destructor (virtual for memory safety).
Definition: Ifpack2_LocalSparseTriangularSolver_def.hpp:313
Teuchos::RCP< const row_matrix_type > getMatrix() const
The original input matrix.
Definition: Ifpack2_LocalSparseTriangularSolver_decl.hpp:263
LocalSparseTriangularSolver()
Constructor that takes no input matrix.
Definition: Ifpack2_LocalSparseTriangularSolver_def.hpp:277
"Preconditioner" that solves local sparse triangular systems.
Definition: Ifpack2_LocalSparseTriangularSolver_decl.hpp:77
void apply(const Tpetra::MultiVector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &X, Tpetra::MultiVector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > &Y, Teuchos::ETransp mode=Teuchos::NO_TRANS, scalar_type alpha=Teuchos::ScalarTraits< scalar_type >::one(), scalar_type beta=Teuchos::ScalarTraits< scalar_type >::zero()) const
Apply the preconditioner to X, and put the result in Y.
Definition: Ifpack2_LocalSparseTriangularSolver_def.hpp:539
Mix-in interface for preconditioners that can change their matrix after construction.
Definition: Ifpack2_Details_CanChangeMatrix.hpp:93
double getInitializeTime() const
Return the time spent in initialize().
Definition: Ifpack2_LocalSparseTriangularSolver_def.hpp:785
void describe(Teuchos::FancyOStream &out, const Teuchos::EVerbosityLevel verbLevel=Teuchos::Describable::verbLevel_default) const
Print this object with given verbosity to the given output stream.
Definition: Ifpack2_LocalSparseTriangularSolver_def.hpp:839
void initialize()
"Symbolic" phase of setup
Definition: Ifpack2_LocalSparseTriangularSolver_def.hpp:359
Declaration of interface for preconditioners that can change their matrix after construction.
double getComputeFlops() const
Return the number of flops in the computation phase.
double getApplyFlops() const
Return the number of flops for the application of the preconditioner.