]> https://gitweb.dealii.org/ - dealii.git/commitdiff
add two Asserts in fe_enriched_step-36 unit test
authorDenis Davydov <davydden@gmail.com>
Wed, 5 Oct 2016 05:27:56 +0000 (07:27 +0200)
committerDenis Davydov <davydden@gmail.com>
Wed, 5 Oct 2016 05:27:56 +0000 (07:27 +0200)
tests/fe/fe_enriched_step-36.cc

index a22183a967221f1fffa6a53451ecde3ef94bb723..22702ae43e9ad2c5836e031455f6f10d913e3414 100644 (file)
@@ -77,6 +77,8 @@ template<int dim>
 double PotentialFunction<dim>::value(const dealii::Point<dim> &p,
                                      const unsigned int ) const
 {
+  Assert (p.square() > 0.,
+          ExcDivideByZero());
   return -1.0 / std::sqrt(p.square());
 }
 
@@ -114,6 +116,8 @@ public:
   {
     Tensor<1,dim> dist = p-origin;
     const double r = dist.norm();
+    Assert (r > 0.,
+            ExcDivideByZero());
     dist/=r;
     return -Z*std::exp(-Z*r)*dist;
   }

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.