]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Introduce a new exception for HDF5. 14246/head
authorWolfgang Bangerth <bangerth@colostate.edu>
Wed, 21 Sep 2022 20:34:12 +0000 (14:34 -0600)
committerWolfgang Bangerth <bangerth@colostate.edu>
Wed, 21 Sep 2022 20:34:12 +0000 (14:34 -0600)
include/deal.II/base/exceptions.h
source/base/data_out_base.cc
source/lac/scalapack.cc

index e4e62af343fee2b73e7e8f30488ec11c557b2a56..dbcf2e6b944843fc94d18f7dcd27660d8a69e2e1 100644 (file)
@@ -1106,6 +1106,15 @@ namespace StandardExceptions
     "if deal.II was configured to use LAPACK, but cmake did not "
     "find a valid LAPACK library.");
 
+  /**
+   * This function requires support for the HDF5 library.
+   */
+  DeclExceptionMsg(
+    ExcNeedsHDF5,
+    "You are attempting to use functionality that requires that deal.II is configured "
+    "with HDF5 support. However, when you called 'cmake', HDF5 support "
+    "was not detected.");
+
   /**
    * This function requires support for the MPI library.
    */
index e4d8710562a23b61f8054f21f4d5331ac00104d4..4cff7171f558fc5ab114ead6e63aa7a21eadd401 100644 (file)
@@ -8825,11 +8825,7 @@ DataOutBase::write_hdf5_parallel(
   (void)mesh_filename;
   (void)solution_filename;
   (void)comm;
-  AssertThrow(false,
-              ExcMessage(
-                "This function requires that deal.II is configured "
-                "with HDF5 support, but when you called 'cmake', HDF5 support "
-                "was not detected."));
+  AssertThrow(false, ExcNeedsHDF5());
 #else
 
   const unsigned int n_ranks = Utilities::MPI::n_mpi_processes(comm);
index ff104138d24ed95b36c005907139119654e3053d..01470b6d8d81981b7c5728e1c4ad56290c96819e 100644 (file)
@@ -2611,11 +2611,7 @@ ScaLAPACKMatrix<NumberType>::save(
 #  ifndef DEAL_II_WITH_HDF5
   (void)filename;
   (void)chunk_size;
-  AssertThrow(false,
-              ExcMessage(
-                "This function requires that deal.II is configured "
-                "with HDF5 support, but when you called 'cmake', HDF5 support "
-                "was not detected."));
+  AssertThrow(false, ExcNeedsHDF5());
 #  else
 
   std::pair<unsigned int, unsigned int> chunks_size_ = chunk_size;
@@ -3047,11 +3043,7 @@ ScaLAPACKMatrix<NumberType>::load(const std::string &filename)
 {
 #  ifndef DEAL_II_WITH_HDF5
   (void)filename;
-  AssertThrow(false,
-              ExcMessage(
-                "This function requires that deal.II is configured "
-                "with HDF5 support, but when you called 'cmake', HDF5 support "
-                "was not detected."));
+  AssertThrow(false, ExcNeedsHDF5());
 #  else
 #    ifdef H5_HAVE_PARALLEL
   // implementation for configurations equipped with a parallel file system

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.