]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
add assertions
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 22 Nov 2001 14:21:00 +0000 (14:21 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Thu, 22 Nov 2001 14:21:00 +0000 (14:21 +0000)
git-svn-id: https://svn.dealii.org/trunk@5239 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/deal.II/source/numerics/matrices.cc

index a605371058c499d4b706cb55bd3d8105f7585e7f..658ccfadc8292e4a783ce44a94451d0d5621be49 100644 (file)
@@ -72,6 +72,11 @@ void MatrixCreator::create_mass_matrix (const Mapping<dim>       &mapping,
                                        SparseMatrix<double>     &matrix,
                                        const Function<dim> * 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<dim>       &mapping,
                                        Vector<double>           &rhs_vector,
                                        const Function<dim> * 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<dim>       &mapping,
                                           SparseMatrix<double>     &matrix,
                                           const Function<dim> * 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<dim>       &mapping,
                                           Vector<double>           &rhs_vector,
                                           const Function<dim> * 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;
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.