From: wolf Date: Thu, 22 Nov 2001 14:21:00 +0000 (+0000) Subject: add assertions X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=944f8b4d713a72483bf07e08acb2c94c6412b2b7;p=dealii-svn.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;