|
|
typedef MatrixType::scalar_type | scalar_type |
| |
|
typedef MatrixType::local_ordinal_type | local_ordinal_type |
| |
|
typedef MatrixType::global_ordinal_type | global_ordinal_type |
| |
|
typedef MatrixType::node_type | node_type |
| |
|
typedef Tpetra::MultiVector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > | mv_type |
| |
|
typedef Tpetra::Vector< scalar_type, local_ordinal_type, global_ordinal_type, node_type > | vector_type |
| |
|
typedef Tpetra::Map< local_ordinal_type, global_ordinal_type, node_type > | map_type |
| |
|
typedef Teuchos::ScalarTraits< scalar_type > | STS |
| |
|
typedef Tpetra::Import< local_ordinal_type, global_ordinal_type, node_type > | import_type |
| |
|
typedef Partitioner< Tpetra::RowGraph< local_ordinal_type, global_ordinal_type, node_type > > | partitioner_type |
| |
|
typedef Tpetra::Experimental::BlockCrsMatrix< scalar_type, local_ordinal_type, global_ordinal_type, node_type > | block_crs_matrix_type |
| |
|
typedef Tpetra::RowMatrix< scalar_type, local_ordinal_type, global_ordinal_type, node_type > | row_matrix_type |
| |
| typedef Kokkos::Details::ArithTraits< scalar_type >::val_type | impl_scalar_type |
| | Internal representation of Scalar in Kokkos::View. More...
|
| |
|
typedef mv_type::dual_view_type::t_host | HostView |
| |
| Teuchos::RCP< const row_matrix_type > | inputMatrix_ |
| | The input matrix to the constructor. More...
|
| |
| int | numBlocks_ |
| | The number of blocks (partitions) in the container. More...
|
| |
| Teuchos::Array< local_ordinal_type > | partitions_ |
| | Local indices of the rows of the input matrix that belong to this block. More...
|
| |
| Teuchos::Array< local_ordinal_type > | blockRows_ |
| | Number of rows in each block. More...
|
| |
| Teuchos::Array< local_ordinal_type > | partitionIndices_ |
| | Starting index in partitions_ of local row indices for each block. More...
|
| |
| Teuchos::RCP< vector_type > | Diag_ |
| | Diagonal elements. More...
|
| |
| bool | IsParallel_ |
| | Whether the problem is distributed across multiple MPI processes. More...
|
| |
| int | OverlapLevel_ |
| | Number of rows of overlap for adjacent blocks. More...
|
| |
| scalar_type | DampingFactor_ |
| | Damping factor, passed to apply() as alpha. More...
|
| |
| Teuchos::RCP< const Tpetra::Import< local_ordinal_type, global_ordinal_type, node_type > > | Importer_ |
| | Importer for importing off-process elements of MultiVectors. More...
|
| |
| local_ordinal_type | NumLocalRows_ |
| | Number of local rows in input matrix. More...
|
| |
| global_ordinal_type | NumGlobalRows_ |
| | Number of global rows in input matrix. More...
|
| |
| global_ordinal_type | NumGlobalNonzeros_ |
| | Number of nonzeros in input matrix. More...
|
| |
| bool | hasBlockCrs_ |
| | Whether the input matrix is a BlockCRS matrix. More...
|
| |
| int | bcrsBlockSize_ |
| | If hasBlockCrs_, the number of DOFs per vertex. Otherwise 1. More...
|
| |
| | Container (const Teuchos::RCP< const row_matrix_type > &matrix, const Teuchos::Array< Teuchos::Array< local_ordinal_type > > &partitions, const Teuchos::RCP< const import_type > &importer, int OverlapLevel, scalar_type DampingFactor) |
| | Constructor. More...
|
| |
| | Container (const Teuchos::RCP< const row_matrix_type > &matrix, const Teuchos::Array< local_ordinal_type > &localRows) |
| | Constructor for single block. More...
|
| |
| virtual | ~Container () |
| | Destructor. More...
|
| |
| Teuchos::ArrayView< const local_ordinal_type > | getLocalRows (int blockIndex) const |
| | Local indices of the rows of the input matrix that belong to this block. More...
|
| |
| virtual void | initialize ()=0 |
| | Do all set-up operations that only require matrix structure. More...
|
| |
| void | setBlockSizes (const Teuchos::Array< Teuchos::Array< local_ordinal_type > > &partitions) |
| | Initialize arrays with information about block sizes. More...
|
| |
|
void | getMatDiag () const |
| |
| virtual void | compute ()=0 |
| | Extract the local diagonal block and prepare the solver. More...
|
| |
|
void | DoJacobi (HostView &X, HostView &Y, int stride) const |
| |
|
void | DoOverlappingJacobi (HostView &X, HostView &Y, HostView &W, int stride) const |
| |
|
void | DoGaussSeidel (HostView &X, HostView &Y, HostView &Y2, int stride) const |
| |
|
void | DoSGS (HostView &X, HostView &Y, HostView &Y2, int stride) const |
| |
| virtual void | setParameters (const Teuchos::ParameterList &List)=0 |
| | Set parameters. More...
|
| |
| virtual bool | isInitialized () const =0 |
| | Return true if the container has been successfully initialized. More...
|
| |
| virtual bool | isComputed () const =0 |
| | Return true if the container has been successfully computed. More...
|
| |
| virtual void | apply (HostView &X, HostView &Y, int blockIndex, int stride, Teuchos::ETransp mode=Teuchos::NO_TRANS, scalar_type alpha=Teuchos::ScalarTraits< scalar_type >::one(), scalar_type beta=Teuchos::ScalarTraits< scalar_type >::zero()) const =0 |
| | Compute Y := alpha * M^{-1} X + beta*Y. More...
|
| |
| virtual void | applyInverseJacobi (const mv_type &, mv_type &, bool, int) const |
| | Compute Y := (1 - a) Y + a D^{-1} (X - R*Y). More...
|
| |
| void | applyMV (mv_type &X, mv_type &Y) const |
| | Wrapper for apply with MVs, used in unit tests (never called by BlockRelaxation) More...
|
| |
| virtual void | weightedApply (HostView &X, HostView &Y, HostView &W, int blockIndex, int stride, Teuchos::ETransp mode=Teuchos::NO_TRANS, scalar_type alpha=Teuchos::ScalarTraits< scalar_type >::one(), scalar_type beta=Teuchos::ScalarTraits< scalar_type >::zero()) const =0 |
| | Compute Y := alpha * diag(D) * M^{-1} (diag(D) * X) + beta*Y. More...
|
| |
| void | weightedApplyMV (mv_type &X, mv_type &Y, vector_type &W) |
| | Wrapper for weightedApply with MVs, used in unit tests (never called by BlockRelaxation) More...
|
| |
|
virtual void | clearBlocks () |
| |
| virtual std::ostream & | print (std::ostream &os) const =0 |
| | Print basic information about the container to os. More...
|
| |
| static std::string | getName () |
| |
template<class MatrixType>
class Ifpack2::Container< MatrixType >
Interface for creating and solving a local linear problem.
- Template Parameters
-
| MatrixType | A specialization of Tpetra::RowMatrix. |
This class is mainly useful for the implementation of BlockRelaxation, and other preconditioners that need to solve linear systems with diagonal blocks of a sparse matrix.
Users of BlockRelaxation (and any analogous preconditioners) do not normally need to interact with the Container interface. However, they do need to specify a specific Container subclass to use, for example as the second template parameter (ContainerType) of BlockRelaxation. Implementations of Container specify
- the kind of data structure used to store the local matrix, and
- how to solve a linear system with the local matrix.
For example, the SparseContainer subclass uses a sparse matrix (in particular, Tpetra::CrsMatrix) to store each diagonal block, and can use any given Ifpack2 Preconditioner subclass to solve linear systems.
A Container can create, populate, and solve a local linear system. The local linear system matrix, B, is a submatrix of the local components of a distributed matrix, A. The idea of Container is to specify the rows of A that are contained in B, then extract B from A, and compute all it is necessary to solve a linear system in B. Then, set the initial guess (if necessary) and right-hand side for B, and solve the linear system in B.
If you are writing a class (comparable to BlockRelaxation) that uses Container, you should use it in the following way:
-
Create a Container object, specifying the global matrix A and the indices of the local rows of A that are contained in B. The latter indices come from a Partitioner object.
-
Optionally, set linear solve parameters using setParameters().
-
Initialize the container by calling initialize().
-
Prepare the linear system solver using compute().
-
Solve the linear system using apply().
For an example of Steps 1-5 above, see the implementation of BlockRelaxation::ExtractSubmatrices() in Ifpack2_BlockRelaxation_def.hpp.