
Public Types | |
| typedef BlockMatrixBase < SparseMatrix > | BaseClass |
| typedef BaseClass::BlockType | BlockType |
| typedef BaseClass::value_type | value_type |
| typedef BaseClass::pointer | pointer |
| typedef BaseClass::const_pointer | const_pointer |
| typedef BaseClass::reference | reference |
| typedef BaseClass::const_reference | const_reference |
| typedef BaseClass::size_type | size_type |
| typedef BaseClass::iterator | iterator |
| typedef BaseClass::const_iterator | const_iterator |
Public Member Functions | |
| BlockSparseMatrix () | |
| ~BlockSparseMatrix () | |
| BlockSparseMatrix & | operator= (const BlockSparseMatrix &) |
| BlockSparseMatrix & | operator= (const double d) |
| void | reinit (const unsigned int n_block_rows, const unsigned int n_block_columns) |
| void | collect_sizes () |
| void | vmult (BlockVector &dst, const BlockVector &src) const |
| void | vmult (BlockVector &dst, const Vector &src) const |
| void | vmult (Vector &dst, const BlockVector &src) const |
| void | vmult (Vector &dst, const Vector &src) const |
| void | Tvmult (BlockVector &dst, const BlockVector &src) const |
| void | Tvmult (BlockVector &dst, const Vector &src) const |
| void | Tvmult (Vector &dst, const BlockVector &src) const |
| void | Tvmult (Vector &dst, const Vector &src) const |
Static Public Member Functions | |
| ::ExceptionBase & | ExcIncompatibleRowNumbers (int arg1, int arg2, int arg3, int arg4) throw (errortext << "The blocks [" << arg1 << ',' << arg2 << "] and [" << arg3 << ',' << arg4 << "] have differing row numbers." ) |
| ::ExceptionBase & | ExcIncompatibleColNumbers (int arg1, int arg2, int arg3, int arg4) throw (errortext << "The blocks [" << arg1 << ',' << arg2 << "] and [" << arg3 << ',' << arg4 << "] have differing column numbers." ) |
Blocked sparse matrix based on the PETScWrappers::SparseMatrix class. This class implements the functions that are specific to the PETSc SparseMatrix base objects for a blocked sparse matrix, and leaves the actual work relaying most of the calls to the individual blocks to the functions implemented in the base class. See there also for a description of when this class is useful.
In contrast to the deal.II-type SparseMatrix class, the PETSc matrices do not have external objects for the sparsity patterns. Thus, one does not determine the size of the individual blocks of a block matrix of this type by attaching a block sparsity pattern, but by calling reinit() to set the number of blocks and then by setting the size of each block separately. In order to fix the data structures of the block matrix, it is then necessary to let it know that we have changed the sizes of the underlying matrices. For this, one has to call the collect_sizes() function, for much the same reason as is documented with the BlockSparsityPattern class.
Definition at line 61 of file petsc_block_sparse_matrix.h.
Typedef the base class for simpler access to its own typedefs.
Definition at line 68 of file petsc_block_sparse_matrix.h.
Typedef the type of the underlying matrix.
Reimplemented from BlockMatrixBase< PETScWrappers::SparseMatrix >.
Definition at line 74 of file petsc_block_sparse_matrix.h.
Import the typedefs from the base class.
Reimplemented from BlockMatrixBase< PETScWrappers::SparseMatrix >.
Definition at line 80 of file petsc_block_sparse_matrix.h.
Reimplemented from BlockMatrixBase< PETScWrappers::SparseMatrix >.
Definition at line 81 of file petsc_block_sparse_matrix.h.
Reimplemented from BlockMatrixBase< PETScWrappers::SparseMatrix >.
Definition at line 82 of file petsc_block_sparse_matrix.h.
Reimplemented from BlockMatrixBase< PETScWrappers::SparseMatrix >.
Definition at line 83 of file petsc_block_sparse_matrix.h.
Reimplemented from BlockMatrixBase< PETScWrappers::SparseMatrix >.
Definition at line 84 of file petsc_block_sparse_matrix.h.
Reimplemented from BlockMatrixBase< PETScWrappers::SparseMatrix >.
Definition at line 85 of file petsc_block_sparse_matrix.h.
Reimplemented from BlockMatrixBase< PETScWrappers::SparseMatrix >.
Definition at line 86 of file petsc_block_sparse_matrix.h.
Reimplemented from BlockMatrixBase< PETScWrappers::SparseMatrix >.
Definition at line 87 of file petsc_block_sparse_matrix.h.
| PETScWrappers::BlockSparseMatrix::BlockSparseMatrix | ( | ) |
Constructor; initializes the matrix to be empty, without any structure, i.e. the matrix is not usable at all. This constructor is therefore only useful for matrices which are members of a class. All other matrices should be created at a point in the data flow where all necessary information is available.
You have to initialize the matrix before usage with reinit(BlockSparsityPattern). The number of blocks per row and column are then determined by that function.
| PETScWrappers::BlockSparseMatrix::~BlockSparseMatrix | ( | ) |
Destructor.
| BlockSparseMatrix& PETScWrappers::BlockSparseMatrix::operator= | ( | const BlockSparseMatrix & | ) |
Pseudo copy operator only copying empty objects. The sizes of the block matrices need to be the same.
| BlockSparseMatrix & BlockSparseMatrix< number >::operator= | ( | const double | d ) | [inline] |
This operator assigns a scalar to a matrix. Since this does usually not make much sense (should we set all matrix entries to this value? Only the nonzero entries of the sparsity pattern?), this operation is only allowed if the actual value to be assigned is zero. This operator only exists to allow for the obvious notation matrix=0, which sets all elements of the matrix to zero, but keep the sparsity pattern previously used.
Definition at line 301 of file petsc_block_sparse_matrix.h.
References Assert, BlockMatrixBase< PETScWrappers::SparseMatrix >::block(), StandardExceptions::ExcScalarAssignmentOnlyForZeroValue(), BlockMatrixBase< PETScWrappers::SparseMatrix >::n_block_cols(), and BlockMatrixBase< PETScWrappers::SparseMatrix >::n_block_rows().
| void PETScWrappers::BlockSparseMatrix::reinit | ( | const unsigned int | n_block_rows, |
| const unsigned int | n_block_columns | ||
| ) |
Resize the matrix, by setting the number of block rows and columns. This deletes all blocks and replaces them by unitialized ones, i.e. ones for which also the sizes are not yet set. You have to do that by calling the reinit functions of the blocks themselves. Do not forget to call collect_sizes() after that on this object.
The reason that you have to set sizes of the blocks yourself is that the sizes may be varying, the maximum number of elements per row may be varying, etc. It is simpler not to reproduce the interface of the SparsityPattern class here but rather let the user call whatever function she desires.
| void PETScWrappers::BlockSparseMatrix::collect_sizes | ( | ) |
This function collects the sizes of the sub-objects and stores them in internal arrays, in order to be able to relay global indices into the matrix to indices into the subobjects. You *must* call this function each time after you have changed the size of the sub-objects.
Reimplemented from BlockMatrixBase< PETScWrappers::SparseMatrix >.
| void BlockSparseMatrix< number >::vmult | ( | BlockVector & | dst, |
| const BlockVector & | src | ||
| ) | const [inline] |
Matrix-vector multiplication: let
with
being this matrix.
Definition at line 316 of file petsc_block_sparse_matrix.h.
References BlockMatrixBase< SparseMatrix >::vmult_block_block().
| void BlockSparseMatrix< number >::vmult | ( | BlockVector & | dst, |
| const Vector & | src | ||
| ) | const [inline] |
Matrix-vector multiplication. Just like the previous function, but only applicable if the matrix has only one block column.
Definition at line 326 of file petsc_block_sparse_matrix.h.
References BlockMatrixBase< SparseMatrix >::vmult_block_nonblock().
| void BlockSparseMatrix< number >::vmult | ( | Vector & | dst, |
| const BlockVector & | src | ||
| ) | const [inline] |
Matrix-vector multiplication. Just like the previous function, but only applicable if the matrix has only one block row.
Definition at line 336 of file petsc_block_sparse_matrix.h.
References BlockMatrixBase< SparseMatrix >::vmult_nonblock_block().
| void BlockSparseMatrix< number >::vmult | ( | Vector & | dst, |
| const Vector & | src | ||
| ) | const [inline] |
Matrix-vector multiplication. Just like the previous function, but only applicable if the matrix has only one block.
Definition at line 346 of file petsc_block_sparse_matrix.h.
References BlockMatrixBase< SparseMatrix >::vmult_nonblock_nonblock().
| void BlockSparseMatrix< number >::Tvmult | ( | BlockVector & | dst, |
| const BlockVector & | src | ||
| ) | const [inline] |
Matrix-vector multiplication: let
with
being this matrix. This function does the same as vmult() but takes the transposed matrix.
Definition at line 355 of file petsc_block_sparse_matrix.h.
References BlockMatrixBase< SparseMatrix >::Tvmult_block_block().
| void BlockSparseMatrix< number >::Tvmult | ( | BlockVector & | dst, |
| const Vector & | src | ||
| ) | const [inline] |
Matrix-vector multiplication. Just like the previous function, but only applicable if the matrix has only one block row.
Definition at line 365 of file petsc_block_sparse_matrix.h.
References BlockMatrixBase< SparseMatrix >::Tvmult_block_nonblock().
| void BlockSparseMatrix< number >::Tvmult | ( | Vector & | dst, |
| const BlockVector & | src | ||
| ) | const [inline] |
Matrix-vector multiplication. Just like the previous function, but only applicable if the matrix has only one block column.
Definition at line 375 of file petsc_block_sparse_matrix.h.
References BlockMatrixBase< SparseMatrix >::Tvmult_nonblock_block().
| void BlockSparseMatrix< number >::Tvmult | ( | Vector & | dst, |
| const Vector & | src | ||
| ) | const [inline] |
Matrix-vector multiplication. Just like the previous function, but only applicable if the matrix has only one block.
Definition at line 385 of file petsc_block_sparse_matrix.h.
References BlockMatrixBase< SparseMatrix >::Tvmult_nonblock_nonblock().
documentation generated on Fri Feb 3 2012 06:04:15 by
doxygen
1.7.2