From: Peter Munch Date: Thu, 5 Mar 2020 10:27:14 +0000 (+0100) Subject: Intoduce and use new ExcNeedsMPI X-Git-Tag: v9.2.0-rc1~450^2 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F9624%2Fhead;p=dealii.git Intoduce and use new ExcNeedsMPI --- diff --git a/include/deal.II/base/exceptions.h b/include/deal.II/base/exceptions.h index a39dc457b9..6444344f11 100644 --- a/include/deal.II/base/exceptions.h +++ b/include/deal.II/base/exceptions.h @@ -1086,6 +1086,14 @@ 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 MPI library. + */ + DeclExceptionMsg( + ExcNeedsMPI, + "You are attempting to use functionality that is only available " + "if deal.II was configured to use MPI."); + /** * This function requires support for the NetCDF library. * diff --git a/source/distributed/tria_base.cc b/source/distributed/tria_base.cc index 189be2a997..e52413f64d 100644 --- a/source/distributed/tria_base.cc +++ b/source/distributed/tria_base.cc @@ -52,9 +52,7 @@ namespace parallel , n_subdomains(Utilities::MPI::n_mpi_processes(this->mpi_communicator)) { #ifndef DEAL_II_WITH_MPI - Assert(false, - ExcMessage("You compiled deal.II without MPI support, for " - "which parallel::TriangulationBase is not available.")); + Assert(false, ExcNeedsMPI()); #endif } @@ -67,9 +65,7 @@ namespace parallel { #ifndef DEAL_II_WITH_MPI (void)other_tria; - Assert(false, - ExcMessage("You compiled deal.II without MPI support, for " - "which parallel::TriangulationBase is not available.")); + Assert(false, ExcNeedsMPI()); #else dealii::Triangulation::copy_triangulation(other_tria);