]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
Another attempt to harmonize output across different systems.
authorkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 17 Apr 2013 16:49:10 +0000 (16:49 +0000)
committerkronbichler <kronbichler@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 17 Apr 2013 16:49:10 +0000 (16:49 +0000)
git-svn-id: https://svn.dealii.org/trunk@29317 0785d39b-7218-0410-832d-ea1e28bc413d

tests/matrix_free/estimate_condition_number_mass.cc
tests/matrix_free/estimate_condition_number_mass/cmp/generic

index f3761d5f13838dc8f102493922416d78fc140df8..6b75e1bc90d2dcc7bcf24335cc1323dd19742452 100644 (file)
@@ -82,7 +82,8 @@ private:
 
 
 template <int dim, int fe_degree>
-void test (const FiniteElement<dim> &fe)
+void test (const FiniteElement<dim> &fe,
+           const unsigned int n_iterations)
 {
   typedef double number;
 
@@ -101,7 +102,7 @@ void test (const FiniteElement<dim> &fe)
   {
     const QGauss<1> quad (fe_degree+1);
     typename MatrixFree<dim,number>::AdditionalData data;
-    data.tasks_block_size = 2;
+    data.tasks_block_size = 8/VectorizedArray<number>::n_array_elements;
     mf_data.reinit (dof, constraints, quad, data);
   }
 
@@ -111,11 +112,21 @@ void test (const FiniteElement<dim> &fe)
   VectorTools::create_right_hand_side(dof, QGauss<dim>(fe_degree+1),
                                       Functions::CosineFunction<dim>(), in);
 
-  SolverControl control(10000, 1e-9*in.l2_norm());
+  // prescribe number of iterations in CG instead of tolerance. This is needed
+  // to get the same test output on different platforms where roundoff errors
+  // accumulate differently. Beware of this strange solver setting when seeing
+  // "failure" in the output
+  SolverControl control(n_iterations, 0);
   typename SolverCG<>::AdditionalData data;
   data.compute_condition_number = true;
   SolverCG<> solver(control,data);
-  solver.solve(mf, out, in, PreconditionIdentity());
+  try
+    {
+      solver.solve(mf, out, in, PreconditionIdentity());
+    }
+  catch (...)
+    {
+    }
   deallog << std::endl;
 }
 
@@ -128,29 +139,30 @@ int main ()
   deallog << std::setprecision (2);
 
   {
+    // iterations taken from results at tolerance 1e-9
     deallog.threshold_double(1.e-9);
     deallog.push("2d");
-    test<2,1>(FE_Q<2>(1));
-    test<2,1>(FE_DGQ<2>(1));
-    test<2,2>(FE_Q<2>(2));
-    test<2,2>(FE_DGQ<2>(2));
-    test<2,4>(FE_Q<2>(4));
-    test<2,4>(FE_Q<2>(QGaussLobatto<1>(5)));
-    test<2,4>(FE_DGQ<2>(4));
-    test<2,4>(FE_Q_Hierarchical<2>(4));
-    test<2,6>(FE_Q<2>(6));
-    test<2,6>(FE_Q<2>(QGaussLobatto<1>(7)));
-    test<2,6>(FE_DGQ<2>(6));
-    test<2,6>(FE_DGQArbitraryNodes<2>(QGaussLobatto<1>(7)));
-    test<2,10>(FE_Q<2>(10));
-    test<2,10>(FE_Q<2>(QGaussLobatto<1>(11)));
-    test<2,16>(FE_Q<2>(QGaussLobatto<1>(17)));
+    test<2,1>(FE_Q<2>(1), 15);
+    test<2,1>(FE_DGQ<2>(1), 3);
+    test<2,2>(FE_Q<2>(2), 34);
+    test<2,2>(FE_DGQ<2>(2), 6);
+    test<2,4>(FE_Q<2>(4), 75);
+    test<2,4>(FE_Q<2>(QGaussLobatto<1>(5)), 56);
+    test<2,4>(FE_DGQ<2>(4), 18);
+    test<2,4>(FE_Q_Hierarchical<2>(4), 736);
+    test<2,6>(FE_Q<2>(6), 161);
+    test<2,6>(FE_Q<2>(QGaussLobatto<1>(7)), 77);
+    test<2,6>(FE_DGQ<2>(6), 38);
+    test<2,6>(FE_DGQArbitraryNodes<2>(QGaussLobatto<1>(7)), 32);
+    test<2,10>(FE_Q<2>(10), 782);
+    test<2,10>(FE_Q<2>(QGaussLobatto<1>(11)), 108);
+    test<2,16>(FE_Q<2>(QGaussLobatto<1>(17)), 156);
     deallog.pop();
     deallog.push("3d");
-    test<3,1>(FE_Q<3>(1));
-    test<3,2>(FE_Q<3>(2));
-    test<3,5>(FE_Q<3>(5));
-    test<3,5>(FE_Q<3>(QGaussLobatto<1>(6)));
+    test<3,1>(FE_Q<3>(1), 37);
+    test<3,2>(FE_Q<3>(2), 80);
+    test<3,5>(FE_Q<3>(5), 494);
+    test<3,5>(FE_Q<3>(QGaussLobatto<1>(6)), 187);
     deallog.pop();
   }
 }
index d2da6a330467d03a174448812243025e9f6b8925..d18d8ad3ee6834e8ba6fddd3412ce69477d55df4 100644 (file)
@@ -1,96 +1,96 @@
 
 DEAL:2d::Testing FE_Q<2>(1)
 DEAL:2d:cg::Starting value 0.11
-DEAL:2d:cg::Convergence step 15 value 0
+DEAL:2d:cg::Failure step 15 value 0
 DEAL:2d:cg::Condition number estimate: 15.
 DEAL:2d::
 DEAL:2d::Testing FE_DGQ<2>(1)
 DEAL:2d:cg::Starting value 0.062
-DEAL:2d:cg::Convergence step 3 value 0
+DEAL:2d:cg::Failure step 3 value 0
 DEAL:2d:cg::Condition number estimate: 3.0
 DEAL:2d::
 DEAL:2d::Testing FE_Q<2>(2)
 DEAL:2d:cg::Starting value 0.067
-DEAL:2d:cg::Convergence step 34 value 0
+DEAL:2d:cg::Failure step 34 value 0
 DEAL:2d:cg::Condition number estimate: 30.
 DEAL:2d::
 DEAL:2d::Testing FE_DGQ<2>(2)
 DEAL:2d:cg::Starting value 0.062
-DEAL:2d:cg::Convergence step 6 value 0
+DEAL:2d:cg::Failure step 6 value 0
 DEAL:2d:cg::Condition number estimate: 45.
 DEAL:2d::
 DEAL:2d::Testing FE_Q<2>(4)
 DEAL:2d:cg::Starting value 0.036
-DEAL:2d:cg::Convergence step 75 value 0
+DEAL:2d:cg::Failure step 75 value 0
 DEAL:2d:cg::Condition number estimate: 1.5e+02
 DEAL:2d::
 DEAL:2d::Testing FE_Q<2>(QGaussLobatto(5))
 DEAL:2d:cg::Starting value 0.035
-DEAL:2d:cg::Convergence step 56 value 0
+DEAL:2d:cg::Failure step 56 value 0
 DEAL:2d:cg::Condition number estimate: 75.
 DEAL:2d::
 DEAL:2d::Testing FE_DGQ<2>(4)
 DEAL:2d:cg::Starting value 0.035
-DEAL:2d:cg::Convergence step 18 value 0
+DEAL:2d:cg::Failure step 18 value 0
 DEAL:2d:cg::Condition number estimate: 2.0e+02
 DEAL:2d::
 DEAL:2d::Testing FE_Q_Hierarchical<2>(4)
 DEAL:2d:cg::Starting value 0.24
-DEAL:2d:cg::Convergence step 736 value 0
+DEAL:2d:cg::Failure step 736 value 0
 DEAL:2d:cg::Condition number estimate: 4.2e+05
 DEAL:2d::
 DEAL:2d::Testing FE_Q<2>(6)
 DEAL:2d:cg::Starting value 0.031
-DEAL:2d:cg::Convergence step 161 value 0
+DEAL:2d:cg::Failure step 161 value 0
 DEAL:2d:cg::Condition number estimate: 1.6e+03
 DEAL:2d::
 DEAL:2d::Testing FE_Q<2>(QGaussLobatto(7))
 DEAL:2d:cg::Starting value 0.024
-DEAL:2d:cg::Convergence step 77 value 0
+DEAL:2d:cg::Failure step 77 value 0
 DEAL:2d:cg::Condition number estimate: 1.4e+02
 DEAL:2d::
 DEAL:2d::Testing FE_DGQ<2>(6)
 DEAL:2d:cg::Starting value 0.030
-DEAL:2d:cg::Convergence step 38 value 0
+DEAL:2d:cg::Failure step 38 value 0
 DEAL:2d:cg::Condition number estimate: 2.0e+03
 DEAL:2d::
 DEAL:2d::Testing FE_DGQArbitraryNodes<2>(QGaussLobatto(7))
 DEAL:2d:cg::Starting value 0.024
-DEAL:2d:cg::Convergence step 32 value 0
+DEAL:2d:cg::Failure step 32 value 0
 DEAL:2d:cg::Condition number estimate: 1.9e+02
 DEAL:2d::
 DEAL:2d::Testing FE_Q<2>(10)
 DEAL:2d:cg::Starting value 0.17
-DEAL:2d:cg::Convergence step 782 value 0
+DEAL:2d:cg::Failure step 782 value 0
 DEAL:2d:cg::Condition number estimate: 2.2e+06
 DEAL:2d::
 DEAL:2d::Testing FE_Q<2>(QGaussLobatto(11))
 DEAL:2d:cg::Starting value 0.015
-DEAL:2d:cg::Convergence step 108 value 0
+DEAL:2d:cg::Failure step 108 value 0
 DEAL:2d:cg::Condition number estimate: 3.3e+02
 DEAL:2d::
 DEAL:2d::Testing FE_Q<2>(QGaussLobatto(17))
 DEAL:2d:cg::Starting value 0.0094
-DEAL:2d:cg::Convergence step 156 value 0
+DEAL:2d:cg::Failure step 156 value 0
 DEAL:2d:cg::Condition number estimate: 7.6e+02
 DEAL:2d::
 DEAL:3d::Testing FE_Q<3>(1)
 DEAL:3d:cg::Starting value 0.035
-DEAL:3d:cg::Convergence step 37 value 0
+DEAL:3d:cg::Failure step 37 value 0
 DEAL:3d:cg::Condition number estimate: 58.
 DEAL:3d::
 DEAL:3d::Testing FE_Q<3>(2)
 DEAL:3d:cg::Starting value 0.018
-DEAL:3d:cg::Convergence step 80 value 0
+DEAL:3d:cg::Failure step 80 value 0
 DEAL:3d:cg::Condition number estimate: 1.6e+02
 DEAL:3d::
 DEAL:3d::Testing FE_Q<3>(5)
 DEAL:3d:cg::Starting value 0.0043
-DEAL:3d:cg::Convergence step 494 value 0
+DEAL:3d:cg::Failure step 494 value 0
 DEAL:3d:cg::Condition number estimate: 8.9e+03
 DEAL:3d::
 DEAL:3d::Testing FE_Q<3>(QGaussLobatto(6))
 DEAL:3d:cg::Starting value 0.0049
-DEAL:3d:cg::Convergence step 187 value 0
+DEAL:3d:cg::Failure step 187 value 0
 DEAL:3d:cg::Condition number estimate: 1.1e+03
 DEAL:3d::

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.