From: Wolfgang Bangerth <bangerth@colostate.edu>
Date: Thu, 20 Apr 2023 00:59:16 +0000 (-0600)
Subject: Make sure block vectors have blocks.
X-Git-Tag: v9.5.0-rc1~309^2~1
X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ba261cb02fe83a3091eae03c3ed29499f79372fc;p=dealii.git

Make sure block vectors have blocks.
---

diff --git a/include/deal.II/sundials/n_vector.templates.h b/include/deal.II/sundials/n_vector.templates.h
index 535c2f41ac..696fc8c64b 100644
--- a/include/deal.II/sundials/n_vector.templates.h
+++ b/include/deal.II/sundials/n_vector.templates.h
@@ -351,6 +351,9 @@ namespace SUNDIALS
         (void)v;
         return MPI_COMM_SELF;
 #  else
+        Assert(v.n_blocks() > 0,
+               ExcMessage("You cannot ask a block vector without blocks "
+                          "for its MPI communicator."));
         return v.block(0).get_mpi_communicator();
 #  endif
       }