]> https://gitweb.dealii.org/ - dealii.git/commitdiff
add assert 15063/head
authorStefano Zampini <stefano.zampini@gmail.com>
Tue, 11 Apr 2023 21:53:51 +0000 (00:53 +0300)
committerStefano Zampini <stefano.zampini@gmail.com>
Tue, 11 Apr 2023 21:53:51 +0000 (00:53 +0300)
source/lac/petsc_parallel_block_sparse_matrix.cc

index f75fb5513d7074ebd93f2e4ba50d7df92dd6767c..fdaa00f15f398c0e80a6c081dbd8d2e0a3750882 100644 (file)
@@ -192,6 +192,24 @@ namespace PETScWrappers
             {
               if (!this->sub_objects[r][c])
                 {
+                  Assert(
+                    row_sizes[r] != size_type(-1),
+                    ExcMessage(
+                      "When passing empty sub-blocks of a block matrix, you need to make "
+                      "sure that at least one block in each block row and block column is "
+                      "non-empty. However, block row " +
+                      std::to_string(r) +
+                      " is completely empty "
+                      "and so it is not possible to determine how many rows it should have."));
+                  Assert(
+                    col_sizes[c] != size_type(-1),
+                    ExcMessage(
+                      "When passing empty sub-blocks of a block matrix, you need to make "
+                      "sure that at least one block in each block row and block column is "
+                      "non-empty. However, block column " +
+                      std::to_string(c) +
+                      " is completely empty "
+                      "and so it is not possible to determine how many columns it should have."));
                   Mat dummy = ::create_dummy_mat(
                     comm,
                     static_cast<PetscInt>(row_local_sizes[r]),

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.