]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Be slightly more forgiving.
authorwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 30 Apr 2003 18:34:36 +0000 (18:34 +0000)
committerwolf <wolf@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 30 Apr 2003 18:34:36 +0000 (18:34 +0000)
git-svn-id: https://svn.dealii.org/trunk@7515 0785d39b-7218-0410-832d-ea1e28bc413d

tests/base/polynomial_test.cc

index cba2d1c3c1f1768d1e07ad2641f5c7aa591feb53..c9a16ef9edf8563035e768dc187cf4d818b4a11a 100644 (file)
@@ -48,20 +48,24 @@ void check_poly(const Point<dim>& x,
       
                                       // Check if compute_value is ok
       double val = p.compute_value(k,x);
-      //if (val != values[k])
-      if (fabs(val - values[k]) > 5.0E-16)
+      if (fabs(val - values[k]) > 5.0E-15)
        deallog << 'P' << k << ": values differ " << val << " != "
                << values[k] << std::endl;
 
                                        // Check if compute_grad is ok
       Tensor<1,dim> grad = p.compute_grad(k,x);
-      if (grad != gradients[k])
+      if ((grad-gradients[k]) * (grad-gradients[k]) > 5e-15*5e-15)
        deallog << 'P' << k << ": gradients differ " << grad << " != "
                << gradients[k] << std::endl;
       
                                       // Check if compute_grad_grad is ok
       Tensor<2,dim> grad2 = p.compute_grad_grad(k,x);
-      if (grad2 != second[k])
+      Tensor<2,dim> diff = grad2-second[k];
+      double s = 0;
+      for (unsigned int i=0; i<dim; ++i)
+       for (unsigned int j=0; j<dim; ++j)
+         s += diff[i][j]*diff[i][j];
+      if (s > 5e-15*5e-15)
        deallog << 'P' << k << ": second derivatives differ " << grad2 << " != "
                << second[k] << std::endl;
 

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.