From: brian Date: Fri, 14 Feb 2003 18:11:46 +0000 (+0000) Subject: added test for Hierarchical. Also changed test (val != values[k]) to allow X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94255d01f77463e32cd5da3414a975f39e779d01;p=dealii-svn.git added test for Hierarchical. Also changed test (val != values[k]) to allow for some difference in the last decimal place. Results for Hierarchical have been spot checked. git-svn-id: https://svn.dealii.org/trunk@7091 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/base/polynomial_test.cc b/tests/base/polynomial_test.cc index 0b65e3a74c..758ed8a77a 100644 --- a/tests/base/polynomial_test.cc +++ b/tests/base/polynomial_test.cc @@ -44,11 +44,12 @@ void check_poly(const Point& x, { // Check if compute_value is ok double val = p.compute_value(k,x); - if (val != values[k]) + //if (val != values[k]) + if (fabs(val - values[k]) > 5.0E-16) deallog << 'P' << k << ": values differ " << val << " != " << values[k] << std::endl; - // Check if compute_grad is ok + // Check if compute_grad is ok Tensor<1,dim> grad = p.compute_grad(k,x); if (grad != gradients[k]) deallog << 'P' << k << ": gradients differ " << grad << " != " @@ -59,7 +60,7 @@ void check_poly(const Point& x, if (grad2 != second[k]) deallog << 'P' << k << ": second derivatives differ " << grad2 << " != " << second[k] << std::endl; - + values[k] *= pow(10, dim); gradients[k] *= pow(10, dim); @@ -141,5 +142,14 @@ int main() check_dimensions(p); + deallog.pop(); + deallog.push("Hierarchical"); + + p.clear (); + for (unsigned int i=0;i<3;++i) + p.push_back (Hierarchical(i)); + + check_dimensions(p); + deallog.pop(); }