]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Adjust error messages in the Histogram class.
authorWolfgang Bangerth <bangerth@math.tamu.edu>
Sun, 15 Mar 2015 06:19:58 +0000 (01:19 -0500)
committerWolfgang Bangerth <bangerth@math.tamu.edu>
Tue, 17 Mar 2015 23:27:42 +0000 (18:27 -0500)
include/deal.II/numerics/histogram.h
source/numerics/histogram.cc

index 787555d139a355f648710cbb8d48ada51c85cac0..889d6253d2de441f5ace0e39279d020cdd6d8a11 100644 (file)
@@ -145,15 +145,9 @@ public:
   /**
    * Exception.
    */
-  DeclException0 (ExcEmptyData);
-  /**
-   * Exception.
-   */
-  DeclException0 (ExcInvalidIntervals);
-  /**
-   * Exception.
-   */
-  DeclException0 (ExcInvalidData);
+  DeclExceptionMsg (ExcEmptyData,
+                    "Your input argument to this function does not appear to "
+                    "have any data in it.");
   /**
    * Exception.
    */
index 1b44f221f63027ada8d4bf2590b0a9269a0d2a89..4811b3529f4ef0efacd3aa24db748d1163a58b4c 100644 (file)
@@ -56,8 +56,10 @@ void Histogram::evaluate (const std::vector<Vector<number> > &values,
                           const unsigned int                  n_intervals,
                           const IntervalSpacing               interval_spacing)
 {
-  Assert (values.size() > 0, ExcEmptyData());
-  Assert (n_intervals > 0, ExcInvalidIntervals());
+  Assert (values.size() > 0,
+          ExcMessage("Your input data needs to contain at least one input vector."));
+  Assert (n_intervals > 0,
+          ExcMessage("The number of intervals needs to be at least one."));
   for (unsigned int i=0; i<values.size(); ++i)
     Assert (values[i].size() > 0, ExcEmptyData());
   Assert (values.size() == y_values_.size(),
@@ -216,7 +218,9 @@ void Histogram::evaluate (const Vector<number>    &values,
 void Histogram::write_gnuplot (std::ostream &out) const
 {
   AssertThrow (out, ExcIO());
-  Assert (!intervals.empty(), ExcEmptyData());
+  Assert (!intervals.empty(),
+          ExcMessage("There is nothing to write into the output file. "
+                     "Did you forget to call the evaluate() function?"));
 
   // do a simple 2d plot, if only
   // one data set is available

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.