]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Improve some error messages in ADHelper classes.
authorJean-Paul Pelteret <jppelteret@gmail.com>
Thu, 6 Dec 2018 13:41:28 +0000 (14:41 +0100)
committerJean-Paul Pelteret <jppelteret@gmail.com>
Thu, 24 Jan 2019 07:44:11 +0000 (08:44 +0100)
source/differentiation/ad/ad_helpers.cc

index d8a7866ba37703406e2235c46093abc04f7770c8..e259ab6019c647723ebc1b5d400dc4ec907c9538 100644 (file)
@@ -752,7 +752,8 @@ namespace Differentiation
       this->finalize_sensitive_independent_variables();
       Assert(this->independent_variables.size() ==
                this->n_independent_variables(),
-             ExcInternalError());
+             ExcDimensionMismatch(this->independent_variables.size(),
+                                  this->n_independent_variables()));
 
       return this->independent_variables;
     }
@@ -876,7 +877,8 @@ namespace Differentiation
                  ExcInternalError());
           Assert(this->independent_variables.size() ==
                    this->n_independent_variables(),
-                 ExcInternalError());
+                 ExcDimensionMismatch(this->independent_variables.size(),
+                                      this->n_independent_variables()));
 
           return this->tapeless_driver.value(this->dependent_variables);
         }
@@ -938,7 +940,8 @@ namespace Differentiation
                  ExcInternalError());
           Assert(this->independent_variables.size() ==
                    this->n_independent_variables(),
-                 ExcInternalError());
+                 ExcDimensionMismatch(this->independent_variables.size(),
+                                      this->n_independent_variables()));
 
           this->tapeless_driver.gradient(this->independent_variables,
                                          this->dependent_variables,
@@ -1008,7 +1011,8 @@ namespace Differentiation
                  ExcInternalError());
           Assert(this->independent_variables.size() ==
                    this->n_independent_variables(),
-                 ExcInternalError());
+                 ExcDimensionMismatch(this->independent_variables.size(),
+                                      this->n_independent_variables()));
 
           this->tapeless_driver.hessian(this->independent_variables,
                                         this->dependent_variables,
@@ -1153,7 +1157,8 @@ namespace Differentiation
                  ExcInternalError());
           Assert(this->independent_variables.size() ==
                    this->n_independent_variables(),
-                 ExcInternalError());
+                 ExcDimensionMismatch(this->independent_variables.size(),
+                                      this->n_independent_variables()));
 
           this->tapeless_driver.jacobian(this->independent_variables,
                                          this->dependent_variables,

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.