From: guido Date: Fri, 9 Jul 2004 14:22:26 +0000 (+0000) Subject: Jacobi added for simple vector X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=342ff387740c26d2a4b737f466946c7d2096cb2d;p=dealii-svn.git Jacobi added for simple vector git-svn-id: https://svn.dealii.org/trunk@9493 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/lac/include/lac/block_sparse_matrix.h b/deal.II/lac/include/lac/block_sparse_matrix.h index 5abf9e5575..a4d9869d8b 100644 --- a/deal.II/lac/include/lac/block_sparse_matrix.h +++ b/deal.II/lac/include/lac/block_sparse_matrix.h @@ -224,6 +224,18 @@ class BlockSparseMatrix : public BlockMatrixBase > template void precondition_Jacobi (BlockVectorType &dst, const BlockVectorType &src, + const number omega = 1.) const; + + /** + * Apply the Jacobi + * preconditioner to a simple vector. + * + * The matrix must be a single + * square block for this. + */ + template + void precondition_Jacobi (Vector &dst, + const Vector &src, const number omega = 1.) const; /** @@ -346,4 +358,19 @@ precondition_Jacobi (BlockVectorType &dst, } +template +template +void +BlockSparseMatrix:: +precondition_Jacobi (Vector &dst, + const Vector &src, + const number omega) const +{ +//TODO: Insert assertions + // do a diagonal preconditioning. uses only + // the diagonal blocks of the matrix + this->block(0,0).precondition_Jacobi (dst, src, omega); +} + + #endif // __deal2__block_sparse_matrix_h