From: bangerth Date: Tue, 26 Jun 2007 05:01:38 +0000 (+0000) Subject: Add a few missing assertions X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bc45a256c02154d39c7172963b470461e84afd45;p=dealii-svn.git Add a few missing assertions git-svn-id: https://svn.dealii.org/trunk@14802 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 38fc98b9fb..08806e30b4 100644 --- a/deal.II/lac/include/lac/block_sparse_matrix.h +++ b/deal.II/lac/include/lac/block_sparse_matrix.h @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006 by the deal.II authors +// Copyright (C) 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -327,7 +327,7 @@ class BlockSparseMatrix : public BlockMatrixBase > * * The matrix must be a single * square block for this. - */ + */ template void precondition_Jacobi (Vector &dst, const Vector &src, @@ -560,7 +560,16 @@ precondition_Jacobi (Vector &dst, const Vector &src, const number omega) const { -//TODO: Insert assertions + // check number of blocks. the sizes of the + // single block is checked in the function + // we call + Assert (this->n_block_cols() == 1, + ExcMessage ("This function only works if the matrix has " + "a single block")); + Assert (this->n_block_rows() == 1, + ExcMessage ("This function only works if the matrix has " + "a single block")); + // do a diagonal preconditioning. uses only // the diagonal blocks of the matrix this->block(0,0).precondition_Jacobi (dst, src, omega);