From: Wolfgang Bangerth Date: Thu, 22 Nov 2001 14:21:00 +0000 (+0000) Subject: add assertions X-Git-Tag: v8.0.0~18594 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=28509d5b4a845d2bbf1870f23bec222246eb1441;p=dealii.git add assertions git-svn-id: https://svn.dealii.org/trunk@5239 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/deal.II/deal.II/source/numerics/matrices.cc b/deal.II/deal.II/source/numerics/matrices.cc index a605371058..658ccfadc8 100644 --- a/deal.II/deal.II/source/numerics/matrices.cc +++ b/deal.II/deal.II/source/numerics/matrices.cc @@ -72,6 +72,11 @@ void MatrixCreator::create_mass_matrix (const Mapping &mapping, SparseMatrix &matrix, const Function * const coefficient) { + Assert (matrix.m() == dof.n_dofs(), + ExcDimensionMismatch (matrix.m(), dof.n_dofs())); + Assert (matrix.n() == dof.n_dofs(), + ExcDimensionMismatch (matrix.n(), dof.n_dofs())); + const unsigned int n_threads = multithread_info.n_default_threads; Threads::ThreadManager thread_manager; @@ -230,6 +235,11 @@ void MatrixCreator::create_mass_matrix (const Mapping &mapping, Vector &rhs_vector, const Function * const coefficient) { + Assert (matrix.m() == dof.n_dofs(), + ExcDimensionMismatch (matrix.m(), dof.n_dofs())); + Assert (matrix.n() == dof.n_dofs(), + ExcDimensionMismatch (matrix.n(), dof.n_dofs())); + const unsigned int n_threads = multithread_info.n_default_threads; Threads::ThreadManager thread_manager; @@ -856,6 +866,11 @@ void MatrixCreator::create_laplace_matrix (const Mapping &mapping, SparseMatrix &matrix, const Function * const coefficient) { + Assert (matrix.m() == dof.n_dofs(), + ExcDimensionMismatch (matrix.m(), dof.n_dofs())); + Assert (matrix.n() == dof.n_dofs(), + ExcDimensionMismatch (matrix.n(), dof.n_dofs())); + const unsigned int n_threads = multithread_info.n_default_threads; Threads::ThreadManager thread_manager; @@ -1019,6 +1034,11 @@ void MatrixCreator::create_laplace_matrix (const Mapping &mapping, Vector &rhs_vector, const Function * const coefficient) { + Assert (matrix.m() == dof.n_dofs(), + ExcDimensionMismatch (matrix.m(), dof.n_dofs())); + Assert (matrix.n() == dof.n_dofs(), + ExcDimensionMismatch (matrix.n(), dof.n_dofs())); + const unsigned int n_threads = multithread_info.n_default_threads; Threads::ThreadManager thread_manager;