From: Wolfgang Bangerth Date: Wed, 21 Sep 2022 20:34:12 +0000 (-0600) Subject: Introduce a new exception for HDF5. X-Git-Tag: v9.5.0-rc1~936^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F14246%2Fhead;p=dealii.git Introduce a new exception for HDF5. --- diff --git a/include/deal.II/base/exceptions.h b/include/deal.II/base/exceptions.h index e4e62af343..dbcf2e6b94 100644 --- a/include/deal.II/base/exceptions.h +++ b/include/deal.II/base/exceptions.h @@ -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. */ diff --git a/source/base/data_out_base.cc b/source/base/data_out_base.cc index e4d8710562..4cff7171f5 100644 --- a/source/base/data_out_base.cc +++ b/source/base/data_out_base.cc @@ -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); diff --git a/source/lac/scalapack.cc b/source/lac/scalapack.cc index ff104138d2..01470b6d8d 100644 --- a/source/lac/scalapack.cc +++ b/source/lac/scalapack.cc @@ -2611,11 +2611,7 @@ ScaLAPACKMatrix::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 chunks_size_ = chunk_size; @@ -3047,11 +3043,7 @@ ScaLAPACKMatrix::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