]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Add assertion.
authorhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 8 Jun 2004 11:43:51 +0000 (11:43 +0000)
committerhartmann <hartmann@0785d39b-7218-0410-832d-ea1e28bc413d>
Tue, 8 Jun 2004 11:43:51 +0000 (11:43 +0000)
git-svn-id: https://svn.dealii.org/trunk@9410 0785d39b-7218-0410-832d-ea1e28bc413d

deal.II/lac/source/petsc_parallel_sparse_matrix.cc

index 81c6e0261b9e08f114f98bb926498214c5675cf0..433d5e469be28ba8154c61356e15f901bbadb9cf 100644 (file)
@@ -201,6 +201,16 @@ namespace PETScWrappers
 
       Assert (row_lengths.size() == m,
               ExcDimensionMismatch (row_lengths.size(), m));
+
+                                      // For the case that
+                                      // local_columns is smaller
+                                      // than one of the row lengths
+                                      // MatCreateMPIAIJ throughs an
+                                      // error. In this case use a
+                                      // PETScWrappers::SparseMatrix
+      for (unsigned int i=0; i<row_lengths.size(); ++i)
+       Assert(row_lengths[i]<=local_columns,
+              ExcIndexRange(row_lengths[i], 1, local_columns+1));
     
                                        // use the call sequence indicating a
                                        // maximal number of elements for each

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.