From 356180eb4e5c12c8d9be0c136c97a17d1d50ce3c Mon Sep 17 00:00:00 2001 From: Wolfgang Bangerth Date: Sun, 15 Mar 2015 01:38:43 -0500 Subject: [PATCH] Adjust error messages in the SolutionTransfer class. --- include/deal.II/numerics/solution_transfer.h | 39 ++++++++------------ source/numerics/solution_transfer.cc | 16 ++++---- 2 files changed, 23 insertions(+), 32 deletions(-) diff --git a/include/deal.II/numerics/solution_transfer.h b/include/deal.II/numerics/solution_transfer.h index b2cb8946d5..24326c7db3 100644 --- a/include/deal.II/numerics/solution_transfer.h +++ b/include/deal.II/numerics/solution_transfer.h @@ -373,37 +373,30 @@ public: /** * Exception */ - DeclException0(ExcNotPrepared); + DeclExceptionMsg(ExcNotPrepared, + "You are attempting an operation for which this object is " + "not prepared. This may be because you either did not call " + "one of the prepare_*() functions at all, or because you " + "called the wrong one for the operation you are currently " + "attempting."); /** * Exception */ - DeclException0(ExcAlreadyPrepForRef); + DeclExceptionMsg(ExcAlreadyPrepForRef, + "You are attempting to call one of the prepare_*() functions " + "of this object to prepare it for an operation for which it " + "is already prepared. Specifically, the object was " + "previously prepared for pure refinement."); /** * Exception */ - DeclException0(ExcAlreadyPrepForCoarseAndRef); - - /** - * Exception - */ - DeclException0(ExcTriaPrepCoarseningNotCalledBefore); - - /** - * Exception - */ - DeclException0(ExcNoInVectorsGiven); - - /** - * Exception - */ - DeclException0(ExcVectorsDifferFromInVectors); - - /** - * Exception - */ - DeclException0(ExcNumberOfDoFsPerCellHasChanged); + DeclExceptionMsg(ExcAlreadyPrepForCoarseAndRef, + "You are attempting to call one of the prepare_*() functions " + "of this object to prepare it for an operation for which it " + "is already prepared. Specifically, the object was " + "previously prepared for both coarsening and refinement."); private: diff --git a/source/numerics/solution_transfer.cc b/source/numerics/solution_transfer.cc index 1d3a05c1ca..f0b1cdfc4e 100644 --- a/source/numerics/solution_transfer.cc +++ b/source/numerics/solution_transfer.cc @@ -139,15 +139,11 @@ SolutionTransfer::refine_interpolate(const VECTOR &in, const unsigned int dofs_per_cell=cell->get_dof_handler().get_fe()[this_fe_index].dofs_per_cell; local_values.reinit(dofs_per_cell, true); - // make sure that the size of the - // stored indices is the same as - // dofs_per_cell. this is kind of a - // test if we use the same fe in the - // hp case. to really do that test we - // would have to store the fe_index - // of all cells + // make sure that the size of the stored indices is the same as + // dofs_per_cell. since we store the desired fe_index, we know + // what this size should be Assert(dofs_per_cell==(*pointerstruct->second.indices_ptr).size(), - ExcNumberOfDoFsPerCellHasChanged()); + ExcInternalError()); for (unsigned int i=0; isecond.indices_ptr)[i]); cell->set_dof_values_by_interpolation(local_values, out, @@ -240,7 +236,9 @@ prepare_for_coarsening_and_refinement(const std::vector &all_in) ExcAlreadyPrepForCoarseAndRef()); const unsigned int in_size=all_in.size(); - Assert(in_size!=0, ExcNoInVectorsGiven()); + Assert(in_size!=0, + ExcMessage("The array of input vectors you pass to this " + "function has no elements. This is not useful.")); clear(); -- 2.39.5