From 63c1813704bb74af9a73d2a0a3dcf5fb2c9ee75b Mon Sep 17 00:00:00 2001 From: Peter Munch Date: Thu, 5 Mar 2020 11:27:14 +0100 Subject: [PATCH] Intoduce and use new ExcNeedsMPI --- include/deal.II/base/exceptions.h | 8 ++++++++ source/distributed/tria_base.cc | 8 ++------ 2 files changed, 10 insertions(+), 6 deletions(-) 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); -- 2.39.5