]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Improve error messages in DerivativeApproximation.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Sun, 15 Mar 2015 05:50:28 +0000 (00:50 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 17 Mar 2015 23:27:41 +0000 (18:27 -0500)
include/deal.II/numerics/derivative_approximation.h
source/numerics/derivative_approximation.cc

index fb729bb89adb60515b0376cbc91e38e6570a5a94..9d3d33360d9df6996946c5e358c66662089d6eb6 100644 (file)
@@ -25,7 +25,7 @@
 #include <deal.II/lac/vector.h>
 #include <deal.II/grid/filtered_iterator.h>
 #ifdef _MSC_VER
-#include <deal.II/dofs/dof_accessor.h>
+#  include <deal.II/dofs/dof_accessor.h>
 #endif
 #include <utility>
 
@@ -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.");
 }
 
 
index 7c7653d18b8e5e70fca26e3e99683c4efb975b65..231f5d0ab60d3f2f37d3670da470cb920dda1590 100644 (file)
@@ -974,8 +974,8 @@ namespace DerivativeApproximation
                             Vector<float>         &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()));
 

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.