From ce51f217bc78fb8d545b23fc78c78ff506d0f953 Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sun, 1 Mar 2015 18:49:04 -0600 Subject: [PATCH] Convert several more DeclException0 to DeclExceptionMsg. --- include/deal.II/numerics/data_out.h | 3 +- include/deal.II/numerics/data_out_dof_data.h | 59 +++++++++++++------- 2 files changed, 41 insertions(+), 21 deletions(-) diff --git a/include/deal.II/numerics/data_out.h b/include/deal.II/numerics/data_out.h index f9a3b249cc..9f6512ee17 100644 --- a/include/deal.II/numerics/data_out.h +++ b/include/deal.II/numerics/data_out.h @@ -273,7 +273,8 @@ public: DeclException1 (ExcInvalidNumberOfSubdivisions, int, << "The number of subdivisions per patch, " << arg1 - << ", is not valid."); + << ", is not valid. It needs to be greater or equal " + << "to one."); private: diff --git a/include/deal.II/numerics/data_out_dof_data.h b/include/deal.II/numerics/data_out_dof_data.h index 2ecaf2a498..1bf2e2202f 100644 --- a/include/deal.II/numerics/data_out_dof_data.h +++ b/include/deal.II/numerics/data_out_dof_data.h @@ -1,6 +1,6 @@ // --------------------------------------------------------------------- // -// Copyright (C) 1999 - 2014 by the deal.II authors +// Copyright (C) 1999 - 2015 by the deal.II authors // // This file is part of the deal.II library. // @@ -701,17 +701,18 @@ public: /** * Exception */ - DeclException0 (ExcNoTriangulationSelected); + DeclExceptionMsg (ExcNoTriangulationSelected, + "For the operation you are attempting, you first need to " + "tell the DataOut or related object which DoFHandler or " + "triangulation you would like to work on."); /** * Exception */ - DeclException0 (ExcNoDoFHandlerSelected); - - /** - * Exception - */ - DeclException0 (ExcDataPostprocessingIsNotPossibleForCellData); + DeclExceptionMsg (ExcNoDoFHandlerSelected, + "For the operation you are attempting, you first need to " + "tell the DataOut or related object which DoFHandler " + "you would like to work on."); /** * Exception @@ -719,9 +720,11 @@ public: DeclException3 (ExcInvalidVectorSize, int, int, int, << "The vector has size " << arg1 - << " but the DoFHandler objects says there are " << arg2 + << " but the DoFHandler object says that there are " << arg2 << " degrees of freedom and there are " << arg3 - << " active cells."); + << " active cells. The size of your vector needs to be" + << " either equal to the number of degrees of freedom, or" + << " equal to the number of active cells."); /** * Exception */ @@ -731,12 +734,16 @@ public: << "description strings since some graphics formats will only accept these." << std::endl << "The string you gave was <" << arg1 - << ">, the invalid character is <" << arg1[arg2] + << ">, within which the invalid character is <" << arg1[arg2] << ">." << std::endl); /** * Exception */ - DeclException0 (ExcOldDataStillPresent); + DeclExceptionMsg (ExcOldDataStillPresent, + "When attaching a triangulation or DoFHandler object, it is " + "not allowed if old data vectors are still referenced. If " + "you want to reuse an object of the current type, you first " + "need to call the 'clear_data_vector()' function."); /** * Exception */ @@ -748,15 +755,21 @@ public: /** * Exception */ - DeclException0 (ExcNoPatches); - /** - * Exception - */ - DeclException0 (ExcIncompatibleDatasetNames); + DeclExceptionMsg (ExcIncompatibleDatasetNames, + "While merging sets of patches, the two sets to be merged " + "need to refer to data that agrees on the names of the " + "various variables represented. In other words, you " + "cannot merge sets of patches that originate from " + "entirely unrelated simulations."); /** * Exception */ - DeclException0 (ExcIncompatiblePatchLists); + DeclExceptionMsg (ExcIncompatiblePatchLists, + "While merging sets of patches, the two sets to be merged " + "need to refer to data that agrees on the number of " + "subdivisions and other properties. In other words, you " + "cannot merge sets of patches that originate from " + "entirely unrelated simulations."); DeclException2 (ExcInvalidVectorDeclaration, int, std::string, @@ -852,8 +865,14 @@ merge_patches (const DataOut_DoFData &source, const Point &shift) { const std::vector source_patches = source.get_patches (); - Assert (patches.size () != 0, ExcNoPatches ()); - Assert (source_patches.size () != 0, ExcNoPatches ()); + Assert ((patches.size () != 0) && + (source_patches.size () != 0), + ExcMessage ("When calling this function, both the current " + "object and the one being merged need to have a " + "nonzero number of patches associated with it. " + "Either you called this function on objects that " + "are empty, or you may have forgotten to call " + "the 'build_patches()' function.")); // check equality of component // names Assert (get_dataset_names() == source.get_dataset_names(), -- 2.39.5