]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Implementation of new test for the new TensorProductPolynomials::compute_value, compu...
authorRalf Hartmann <Ralf.Hartmann@dlr.de>
Tue, 8 May 2001 09:54:34 +0000 (09:54 +0000)
committerRalf Hartmann <Ralf.Hartmann@dlr.de>
Tue, 8 May 2001 09:54:34 +0000 (09:54 +0000)
git-svn-id: https://svn.dealii.org/trunk@4559 0785d39b-7218-0410-832d-ea1e28bc413d

tests/base/polynomial_test.cc
tests/base/polynomial_test.checked

index eccc7653aeece4195b0c0beda56ccde36292df5b..b8e639aa675a7ec4d4289b5ac609398340a1191a 100644 (file)
@@ -151,36 +151,43 @@ int main(int, char)
     pols.push_back(LagrangeEquidistant(p, i));
   
   TensorProductPolynomials<2> tp_pol(pols);
-  vector<double> vs(n_tensor_pols);
-  vector<Tensor<1,2> > grads(n_tensor_pols);
-  vector<Tensor<2,2> > grad_grads(n_tensor_pols);
 
   double v_exact;
   Tensor<1,2> grad_exact;
   Tensor<2,2> grad_grad_exact;
   
-  double xi=0.35;
-  double eta=0.62;
-  Point<2> point(xi,eta);
-  tp_pol.compute(point, vs, grads, grad_grads);
-
+  Point<2> point(0.35,0.62);
                                   // 4th shape function of Q3<2> is
                                   // equivalent to its 1st shape
                                   // function in lexicographical
                                   // order.
   Q3_4th_shape_function_values_and_grads_dim2(point, v_exact, grad_exact, grad_grad_exact);
-
+  
   unsigned int i=1;
-  deallog << "v_" << i << "=" << vs[i] << std::endl;
+  double v=tp_pol.compute_value(i, point);
+  Tensor<1,2> grad=tp_pol.compute_grad(i, point);
+  Tensor<2,2> grad_grad=tp_pol.compute_grad_grad(i, point);
+
+  vector<double> vs(n_tensor_pols);
+  vector<Tensor<1,2> > grads(n_tensor_pols);
+  vector<Tensor<2,2> > grad_grads(n_tensor_pols);
+  tp_pol.compute(point, vs, grads, grad_grads);
+
+
+  deallog << "v=" << v << std::endl;
+  deallog << "vs[" << i << "]=" << vs[i] << std::endl;
   deallog << "v_exact=" << v_exact << std::endl;
-  deallog << "grad_v_" << i << "=" << grads[i] << std::endl;
+  deallog << "grad=" << grad << std::endl;
+  deallog << "grads[" << i << "]=" << grads[i] << std::endl;
   deallog << "grad_exact=" << grad_exact << std::endl;
   for (unsigned int j=0; j<grad_grads[i].dimension; ++j)
     for (unsigned int k=0; k<grad_grads[i].dimension; ++k)
       {
-       deallog << "grad_grads_" << i<< "[" << j << "][" << k << "]="
+       deallog << "grad_grad[" << j << "][" << k << "]="
+               << grad_grad[j][k] << std::endl;
+       deallog << "grad_grads[" << i<< "][" << j << "][" << k << "]="
                << grad_grads[i][j][k] << std::endl;
-       deallog << "grad2_exact[" << j << "][" << k << "]="
+       deallog << "grad_grad_exact[" << j << "][" << k << "]="
                << grad_grad_exact[j][k] << std::endl;
       }
 }
index b6284bba514ac98b982bf98acf621713bab4833f..c7062b7cd461e549cb790748ddb378ef928cab35 100644 (file)
@@ -77,15 +77,21 @@ DEAL::ok
 DEAL::
 DEAL::Test of TensorProductPolynomials:
 DEAL::2D Example:
-DEAL::v_1=-0.02
+DEAL::v=-0.02
+DEAL::vs[1]=-0.02
 DEAL::v_exact=-0.02
-DEAL::grad_v_1=0.04 0.45
+DEAL::grad=0.04 0.45
+DEAL::grads[1]=0.04 0.45
 DEAL::grad_exact=0.04 0.45
-DEAL::grad_grads_1[0][0]=0.38
-DEAL::grad2_exact[0][0]=0.38
-DEAL::grad_grads_1[0][1]=-0.84
-DEAL::grad2_exact[0][1]=-0.84
-DEAL::grad_grads_1[1][0]=-0.84
-DEAL::grad2_exact[1][0]=-0.84
-DEAL::grad_grads_1[1][1]=1.22
-DEAL::grad2_exact[1][1]=1.22
+DEAL::grad_grad[0][0]=0.38
+DEAL::grad_grads[1][0][0]=0.38
+DEAL::grad_grad_exact[0][0]=0.38
+DEAL::grad_grad[0][1]=-0.84
+DEAL::grad_grads[1][0][1]=-0.84
+DEAL::grad_grad_exact[0][1]=-0.84
+DEAL::grad_grad[1][0]=-0.84
+DEAL::grad_grads[1][1][0]=-0.84
+DEAL::grad_grad_exact[1][0]=-0.84
+DEAL::grad_grad[1][1]=1.22
+DEAL::grad_grads[1][1][1]=1.22
+DEAL::grad_grad_exact[1][1]=1.22

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.