From: Wolfgang Bangerth Date: Sun, 15 Mar 2015 05:50:28 +0000 (-0500) Subject: Improve error messages in DerivativeApproximation. X-Git-Tag: v8.3.0-rc1~369^2~8 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cc6deead72a7f9727c911e534adc08bd82b203dd;p=dealii.git Improve error messages in DerivativeApproximation. --- diff --git a/include/deal.II/numerics/derivative_approximation.h b/include/deal.II/numerics/derivative_approximation.h index fb729bb89a..9d3d33360d 100644 --- a/include/deal.II/numerics/derivative_approximation.h +++ b/include/deal.II/numerics/derivative_approximation.h @@ -25,7 +25,7 @@ #include #include #ifdef _MSC_VER -#include +# include #endif #include @@ -284,14 +284,21 @@ namespace DerivativeApproximation /** * Exception */ - DeclException2 (ExcInvalidVectorLength, + DeclException2 (ExcVectorLengthVsNActiveCells, int, int, - << "Vector has length " << arg1 << ", but should have " - << arg2); + << "The output vector needs to have a size equal " + "to the number of active cells of your triangulation " + "but has length " << arg1 << "There are " + << arg2 << " active cells in your triangulation."); /** * Exception */ - DeclException0 (ExcInsufficientDirections); + DeclExceptionMsg (ExcInsufficientDirections, + "We have encountered a cell on which the number of linearly " + "independent directions that span the matrix Y (discussed " + "in the documentation of the DerivativeApproximation " + "class) is not equal to dim. The matrix Y then is " + "rank deficient and can not be inverted."); } diff --git a/source/numerics/derivative_approximation.cc b/source/numerics/derivative_approximation.cc index 7c7653d18b..231f5d0ab6 100644 --- a/source/numerics/derivative_approximation.cc +++ b/source/numerics/derivative_approximation.cc @@ -974,8 +974,8 @@ namespace DerivativeApproximation Vector &derivative_norm) { Assert (derivative_norm.size() == dof_handler.get_tria().n_active_cells(), - ExcInvalidVectorLength (derivative_norm.size(), - dof_handler.get_tria().n_active_cells())); + ExcVectorLengthVsNActiveCells (derivative_norm.size(), + dof_handler.get_tria().n_active_cells())); Assert (component < dof_handler.get_fe().n_components(), ExcIndexRange (component, 0, dof_handler.get_fe().n_components()));