SchurMatrix< MA_inverse, MB, MDt, MC > Class Template Reference
[Derived matrices]

Inheritance diagram for SchurMatrix< MA_inverse, MB, MDt, MC >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 SchurMatrix (const MA_inverse &Ainv, const MB &B, const MDt &Dt, const MC &C, VectorMemory< BlockVector< double > > &mem, const std::vector< unsigned int > &signature=std::vector< unsigned int >(0))
void prepare_rhs (BlockVector< double > &dst, const BlockVector< double > &src) const
void vmult (BlockVector< double > &dst, const BlockVector< double > &src) const
double residual (BlockVector< double > &dst, const BlockVector< double > &src, const BlockVector< double > &rhs) const
void postprocess (BlockVector< double > &dst, const BlockVector< double > &src, const BlockVector< double > &rhs) const
void debug_level (unsigned int l)

Private Member Functions

 SchurMatrix (const SchurMatrix< MA_inverse, MB, MDt, MC > &)
SchurMatrixoperator= (const SchurMatrix< MA_inverse, MB, MDt, MC > &)

Private Attributes

const SmartPointer< const
MA_inverse > 
Ainv
const SmartPointer< const MB > B
const SmartPointer< const MDt > Dt
const SmartPointer< const MC > C
VectorMemory< BlockVector
< double > > & 
mem
std::vector< unsigned intsignature
unsigned int debug

Detailed Description

template<class MA_inverse, class MB, class MDt, class MC>
class SchurMatrix< MA_inverse, MB, MDt, MC >

Schur complement of a block matrix.

Given a non-singular matrix A (often positive definite) and a positive semi-definite matrix C as well as matrices B and Dt of full rank, this class implements a new matrix, the Schur complement a the system of equations of the structure

 * /        \  /   \     /   \
 * |  A  Dt |  | u |  -  | f |
 * | -B  C  |  | p |  -  | g |
 * \        /  \   /     \   /
 * 

Multiplication with the Schur matrix S is the operation

 * S p = C p + B A-inverse Dt-transpose p,
 * 

which is an operation within the space for p.

The data handed to the Schur matrix are as follows:

A: the inverse of A is stored, instead of A. This allows the application to use the most efficient form of inversion, iterative or direct.

B, C: these matrices are stored "as is".

Dt: the computation of the Schur complement involves the function Tvmult of the matrix Dt, not vmult! This way, it is sufficient to build only one matrix B for the symmetric Schur complement and use it twice.

All matrices involved are of arbitrary type and vectors are BlockVectors. This way, SchurMatrix can be coupled with any matrix classes providing vmult and Tvmult and can be even nested. Since SmartPointers of matrices are stored, the matrix blocks should be derived from Subscriptor.

Since the Schur complement of a matrix corresponds to a Gaussian block elimination, the right hand side of the condensed system must be preprocessed. Furthermore, the eliminated variable must be reconstructed after solving.

 *   g = g + B A-inverse f
 *   u = A-inverse (f - D-transpose p)
 * 

Applying these transformations, the solution of the system above by a SchurMatrix schur is coded as follows:

 *   schur.prepare_rhs (g, f);
 *   solver.solve (schur, p, g, precondition);
 *   schur.postprocess (u, p);
 * 
Author:
Guido Kanschat, 2000, 2001, 2002

Constructor & Destructor Documentation

template<class MA_inverse , class MB , class MDt , class MC >
SchurMatrix< MA_inverse, MB, MDt, MC >::SchurMatrix ( const MA_inverse &  Ainv,
const MB &  B,
const MDt &  Dt,
const MC &  C,
VectorMemory< BlockVector< double > > &  mem,
const std::vector< unsigned int > &  signature = std::vector<unsigned int>(0) 
) [inline]

Constructor. This constructor receives all the matrices needed. Furthermore, it gets a reference to a memory structure for obtaining block vectors.

Optionally, the length of the u-vector can be provided.

For the meaning of the matrices see the class documentation.

template<class MA_inverse , class MB , class MDt , class MC >
SchurMatrix< MA_inverse, MB, MDt, MC >::SchurMatrix ( const SchurMatrix< MA_inverse, MB, MDt, MC > &   )  [private]

No copy constructor.


Member Function Documentation

template<class MA_inverse , class MB , class MDt , class MC >
void SchurMatrix< MA_inverse, MB, MDt, MC >::prepare_rhs ( BlockVector< double > &  dst,
const BlockVector< double > &  src 
) const [inline]

Do block elimination of the right hand side. Given right hand sides for both components of the block system, this function provides the right hand side for the Schur complement.

The result is stored in the first argument, which is also part of the input data. If it is necessary to conserve the data, dst must be copied before calling this function. This is reasonable, since in many cases, only the pre-processed right hand side is needed.

References Assert, BlockVectorBase< Vector< Number > >::block(), deallog, BlockVectorBase< Vector< Number > >::l2_norm(), BlockVectorBase< Vector< Number > >::n_blocks(), LogStream::pop(), LogStream::push(), and BlockVector< Number >::reinit().

template<class MA_inverse , class MB , class MDt , class MC >
void SchurMatrix< MA_inverse, MB, MDt, MC >::vmult ( BlockVector< double > &  dst,
const BlockVector< double > &  src 
) const [inline]
template<class MA_inverse , class MB , class MDt , class MC >
double SchurMatrix< MA_inverse, MB, MDt, MC >::residual ( BlockVector< double > &  dst,
const BlockVector< double > &  src,
const BlockVector< double > &  rhs 
) const [inline]

Computation of the residual of the Schur complement.

References BlockVectorBase< Vector< Number > >::l2_norm(), and BlockVector< Number >::scale().

template<class MA_inverse , class MB , class MDt , class MC >
void SchurMatrix< MA_inverse, MB, MDt, MC >::postprocess ( BlockVector< double > &  dst,
const BlockVector< double > &  src,
const BlockVector< double > &  rhs 
) const [inline]
template<class MA_inverse , class MB , class MDt , class MC >
void SchurMatrix< MA_inverse, MB, MDt, MC >::debug_level ( unsigned int  l  )  [inline]

Select debugging information for log-file. Debug level 1 is defined and writes the norm of every vector before and after each operation. Debug level 0 turns off debugging information.

template<class MA_inverse , class MB , class MDt , class MC >
SchurMatrix& SchurMatrix< MA_inverse, MB, MDt, MC >::operator= ( const SchurMatrix< MA_inverse, MB, MDt, MC > &   )  [private]

No assignment.

Reimplemented from Subscriptor.


Member Data Documentation

template<class MA_inverse , class MB , class MDt , class MC >
const SmartPointer<const MA_inverse> SchurMatrix< MA_inverse, MB, MDt, MC >::Ainv [private]

Pointer to inverse of upper left block.

template<class MA_inverse , class MB , class MDt , class MC >
const SmartPointer<const MB> SchurMatrix< MA_inverse, MB, MDt, MC >::B [private]

Pointer to lower left block.

template<class MA_inverse , class MB , class MDt , class MC >
const SmartPointer<const MDt> SchurMatrix< MA_inverse, MB, MDt, MC >::Dt [private]

Pointer to transpose of upper right block.

template<class MA_inverse , class MB , class MDt , class MC >
const SmartPointer<const MC> SchurMatrix< MA_inverse, MB, MDt, MC >::C [private]

Pointer to lower right block.

template<class MA_inverse , class MB , class MDt , class MC >
VectorMemory<BlockVector<double> >& SchurMatrix< MA_inverse, MB, MDt, MC >::mem [private]

Auxiliary memory for vectors.

template<class MA_inverse , class MB , class MDt , class MC >
std::vector<unsigned int> SchurMatrix< MA_inverse, MB, MDt, MC >::signature [private]

Optional signature of the u-vector.

template<class MA_inverse , class MB , class MDt , class MC >
unsigned int SchurMatrix< MA_inverse, MB, MDt, MC >::debug [private]

Switch for debugging information.


The documentation for this class was generated from the following file:

deal.II documentation generated on Mon Nov 23 22:58:04 2009 by doxygen 1.6.1