From 28509d5b4a845d2bbf1870f23bec222246eb1441 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Thu, 22 Nov 2001 14:21:00 +0000 Subject: [PATCH] add assertions git-svn-id: https://svn.dealii.org/trunk@5239 0785d39b-7218-0410-832d-ea1e28bc413d --- deal.II/deal.II/source/numerics/matrices.cc | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) 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; -- 2.39.5