|
| LocalSparseTriangularSolver (const Teuchos::RCP< const row_matrix_type > &A) |
| Constructor. More...
|
|
| LocalSparseTriangularSolver (const Teuchos::RCP< const row_matrix_type > &A, const Teuchos::RCP< Teuchos::FancyOStream > &out) |
| Constructor that takes an optional debug output stream. More...
|
|
virtual | ~LocalSparseTriangularSolver () |
| Destructor (virtual for memory safety). More...
|
|
void | setParameters (const Teuchos::ParameterList ¶ms) |
| Set this object's parameters. More...
|
|
void | initialize () |
| "Symbolic" phase of setup More...
|
|
bool | isInitialized () const |
| Return true if the preconditioner has been successfully initialized. More...
|
|
void | compute () |
| "Numeric" phase of setup More...
|
|
bool | isComputed () const |
| Return true if compute() has been called. More...
|
|
|
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. More...
|
|
Teuchos::RCP< const map_type > | getDomainMap () const |
| The domain of this operator. More...
|
|
Teuchos::RCP< const map_type > | getRangeMap () const |
| The range of this operator. More...
|
|
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. More...
|
|
Teuchos::RCP< const Teuchos::Comm< int > > | getComm () const |
| This operator's communicator. More...
|
|
Teuchos::RCP< const row_matrix_type > | getMatrix () const |
| The original input matrix. More...
|
|
double | getComputeFlops () const |
| Return the number of flops in the computation phase. More...
|
|
double | getApplyFlops () const |
| Return the number of flops for the application of the preconditioner. More...
|
|
int | getNumInitialize () const |
| Return the number of calls to initialize(). More...
|
|
int | getNumCompute () const |
| Return the number of calls to compute(). More...
|
|
int | getNumApply () const |
| Return the number of calls to apply(). More...
|
|
double | getInitializeTime () const |
| Return the time spent in initialize(). More...
|
|
double | getComputeTime () const |
| Return the time spent in compute(). More...
|
|
double | getApplyTime () const |
| Return the time spent in apply(). More...
|
|
|
std::string | description () const |
| A one-line description of this object. More...
|
|
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. More...
|
|
virtual void | setMatrix (const Teuchos::RCP< const row_matrix_type > &A) |
| Set this preconditioner's matrix. More...
|
|
virtual | ~Preconditioner () |
| Destructor. More...
|
|
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. More...
|
|
virtual | ~CanChangeMatrix () |
| Destructor. More...
|
|
template<class MatrixType>
class Ifpack2::LocalSparseTriangularSolver< MatrixType >
"Preconditioner" that solves local sparse triangular systems.
- Template Parameters
-
MatrixType | Specialization of Tpetra::RowMatrix. |
This class solves local sparse triangular systems. "Local" means "per MPI process." The matrix itself may be distributed across multiple MPI processes, but this class works on each MPI process' part of the matrix, and the input and output multivectors, separately. (See this class' constructor for details.)
This effectively assumes that the global matrix is block diagonal. Triangular solves usually imply that these blocks are square. If a particular triangular solver knows how to deal with nonsquare blocks, though, this is allowed.
The implementation currently requires that the input Tpetra::RowMatrix actually be a Tpetra::CrsMatrix. This lets us optimize without necessarily copying data structures. We may relax this restriction in the future.
If you are writing a new Ifpack2 class that needs to solve local sparse triangular systems stored as Tpetra::CrsMatrix, use this class only.
template<class MatrixType >
Constructor.
- Parameters
-
A | [in] The input sparse matrix. Though its type is Tpetra::RowMatrix for consistency with other Ifpack2 solvers, this must be a Tpetra::CrsMatrix specialization. |
The input matrix A may be distributed across multiple MPI processes. This class' apply() method will use A's Import object, if it exists, to Import the input MultiVector from the domain Map to the column Map. It will also use A's Export object, if it exists, to Export the output MultiVector from the row Map to the range Map. Thus, to avoid MPI communication and local permutations, construct A so that the row, column, range, and domain Maps are all identical.
On the other hand, you may encode local permutations in the matrix's Maps, and let Import and/or Export execute them for you.
The input matrix must have local properties corresponding to the way in which one wants to solve. ("Local" means "to each MPI
process.") For example, if one wants to solve lower triangular systems with an implicit unit diagonal, the matrix A must have these properties. If the matrix does not know whether it has these properties and the user does not specify them, then this class is responsible for figuring out whether the matrix has those properties.
template<class MatrixType >
void Ifpack2::LocalSparseTriangularSolver< MatrixType >::describe |
( |
Teuchos::FancyOStream & |
out, |
|
|
const Teuchos::EVerbosityLevel |
verbLevel = Teuchos::Describable::verbLevel_default |
|
) |
| const |
Print this object with given verbosity to the given output stream.
- Parameters
-
out | [out] Output stream to which to print |
verbLevel | [in] Verbosity level |
You may create a Teuchos::FancyOStream from any std::ostream. For example, to wrap std::cout in a FancyOStream, do this:
Teuchos::RCP<Teuchos::FancyOStream> out =
Teuchos::getFancyOStream (Teuchos::rcpFromRef (std::cout));
To wrap a new std::ostringstream in a FancyOStream, do this:
auto osPtr = Teuchos::rcp (new std::ostringstream ());
Teuchos::RCP<Teuchos::FancyOStream> out = Teuchos::getFancyOStream (osPtr);
std::cout << osPtr->str () << std::endl;