]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Adjust tests to better cover Gauss-Lobatto and equidistant points
authorMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Tue, 5 Apr 2016 12:51:44 +0000 (14:51 +0200)
committerMartin Kronbichler <kronbichler@lnm.mw.tum.de>
Sat, 9 Apr 2016 13:49:09 +0000 (15:49 +0200)
19 files changed:
tests/bits/point_difference_01.cc
tests/bits/point_difference_02.cc
tests/bits/point_value_01.cc
tests/bits/point_value_02.cc
tests/codim_one/error_estimator_01.cc
tests/fe/fe_data_test.cc
tests/fe/fe_tools_01.cc
tests/fe/get_name_01.cc
tests/fe/get_name_02.cc
tests/fe/restrict_prolongation_01.cc
tests/fe/up_and_down.cc
tests/matrix_free/estimate_condition_number_mass.cc
tests/multigrid/transfer_matrix_free_01.cc
tests/multigrid/transfer_matrix_free_02.cc
tests/multigrid/transfer_matrix_free_03.cc
tests/multigrid/transfer_matrix_free_04.cc
tests/multigrid/transfer_matrix_free_05.cc
tests/multigrid/transfer_matrix_free_06.cc
tests/trilinos/precondition_muelu_q_iso_q1.cc

index 0df9665a5852298d539b98a8f5868ed26eae2767..b74b69b1639ec1d9074cb8aa6be8508050f80794 100644 (file)
@@ -151,12 +151,12 @@ check ()
         {
           VectorTools::point_difference (dof, v, function, difference, p[i]);
           deallog << difference(0) << std::endl;
-          Assert (difference(0) < 1e-4, ExcInternalError());
+          Assert (difference(0) < 2e-4, ExcInternalError());
 
           VectorTools::point_difference (dof, v, ZeroFunction<dim>(),
                                          difference, p[i]);
           deallog << difference(0) << std::endl;
-          Assert (std::abs(-difference(0) - function.value(p[i])) < 1e-4,
+          Assert (std::abs(-difference(0) - function.value(p[i])) < 2e-4,
                   ExcInternalError());
         }
     }
index 517cbd22fbf41e7ac70b5f6ae7371172acee5330..b6d8ebf93c81a0f3b42094addb0a97c21159a87c 100644 (file)
@@ -156,12 +156,12 @@ check ()
         {
           VectorTools::point_difference (mapping, dof, v, function, difference, p[i]);
           deallog << difference(0) << std::endl;
-          Assert (difference(0) < 1e-4, ExcInternalError());
+          Assert (difference(0) < 2e-4, ExcInternalError());
 
           VectorTools::point_difference (mapping, dof, v, ZeroFunction<dim>(),
                                          difference, p[i]);
           deallog << difference(0) << std::endl;
-          Assert (std::abs(-difference(0) - function.value(p[i])) < 1e-4,
+          Assert (std::abs(-difference(0) - function.value(p[i])) < 2e-4,
                   ExcInternalError());
         }
     }
index d834ade8768dbe1266a2ab509e7b459acb6c3635..46f0b815b41c7bee25ebfd5470ba228581b883e6 100644 (file)
@@ -151,11 +151,11 @@ check ()
           VectorTools::point_value (dof, v, p[i], value);
           deallog << -value(0) << std::endl;
 
-          Assert (std::abs(value(0) - function.value(p[i])) < 1e-4,
+          Assert (std::abs(value(0) - function.value(p[i])) < 2e-4,
                   ExcInternalError());
 
           const double scalar_value = VectorTools::point_value (dof, v, p[i]);
-          Assert (std::abs(value(0) - scalar_value) < 1e-4,
+          Assert (std::abs(value(0) - scalar_value) < 2e-4,
                   ExcInternalError());
         }
     }
index f80c6ad1989becdbc911c52a80e77d0bcc639838..daf1bfebc8f8fb56bb4b34948a1d0ad5fbdc6a88 100644 (file)
@@ -153,11 +153,11 @@ check ()
           VectorTools::point_value (mapping, dof, v, p[i], value);
           deallog << -value(0) << std::endl;
 
-          Assert (std::abs(value(0) - function.value(p[i])) < 1e-4,
+          Assert (std::abs(value(0) - function.value(p[i])) < 2e-4,
                   ExcInternalError());
 
           const double scalar_value = VectorTools::point_value (mapping, dof, v, p[i]);
-          Assert (std::abs(value(0) - scalar_value) < 1e-4,
+          Assert (std::abs(value(0) - scalar_value) < 2e-4,
                   ExcInternalError());
         }
     }
index 340af0c321f14a28e3e8ce87f0784a02470a7c20..743b06ee6362180454b45aed491edb74dfc263f9 100644 (file)
@@ -202,7 +202,7 @@ check ()
 int main ()
 {
   std::ofstream logfile ("output");
-  deallog << std::setprecision (2);
+  deallog << std::setprecision (4);
   deallog << std::fixed;
   deallog.attach(logfile);
 
index 573db614516ccd15d3500d964386f0f5c8f7d56f..9b72b18ff30b7f920ea6ee5714981d0e5ee1468b 100644 (file)
@@ -115,9 +115,9 @@ void test_fe_datas()
   deallog << (*fe_datas.rbegin())->get_name() << std::endl;
   fe_datas.push_back(new FE_DGQ<dim> (2));
   deallog << (*fe_datas.rbegin())->get_name() << std::endl;
-  fe_datas.push_back(new FE_DGQ<dim> (4));
+  fe_datas.push_back(new FE_DGQArbitraryNodes<dim> (QIterated<1>(QTrapez<1>(),4)));
   deallog << (*fe_datas.rbegin())->get_name() << std::endl;
-  fe_datas.push_back(new FE_DGQArbitraryNodes<dim> (QGaussLobatto<1>(5)));
+  fe_datas.push_back(new FE_DGQ<dim> (4));
   deallog << (*fe_datas.rbegin())->get_name() << std::endl;
   fe_datas.push_back(new FE_DGQArbitraryNodes<dim> (QGauss<1>(3)));
   deallog << (*fe_datas.rbegin())->get_name() << std::endl;
index 3a694023993eda6b87a616665c9e319ae42892f0..d9f5d9082856cc64bfdc25d26746b2a0d2e0db6e 100644 (file)
@@ -52,8 +52,10 @@ main()
   test_fe<1>("FE_Q(1)");
   test_fe<1>("FE_Q(2)");
   test_fe<1>("FE_Q<1>(2)");
-  test_fe<1>("FE_Q(QGaussLobatto(3))");
+  test_fe<1>("FE_Q(QIterated(QTrapez(),2))");
   test_fe<1>("FE_Q(QGaussLobatto(4))");
+  test_fe<1>("FE_Q(3)");
+  test_fe<1>("FE_Q(QIterated(QTrapez(),3))");
   test_fe<2>("FE_Q(1)");
   test_fe<2>("FE_Q<2>(2)");
   test_fe<2>("FE_Q<dim>(2)");
@@ -62,6 +64,7 @@ main()
   test_fe<2>("FE_RaviartThomas(1)");
   test_fe<2>("FE_Q(QGaussLobatto(3))");
   test_fe<2>("FE_Q(QGaussLobatto(4))");
+  test_fe<2>("FE_Q(QIterated(QTrapez(),3))");
   test_fe<3>("FE_Q(1)");
   test_fe<1>("FESystem<1>[FE_Q<dim>(2)^dim-FE_DGQ<d>(1)]");
   test_fe<2>("FESystem<2>[FE_Q<2>(2)^dim-FE_DGQ<2>(1)]");
index d2701d7d38140cd120a8010ed43fda1bae016dea..0ddc7d7fa534508d0fa95cb028d523dcbf68af29 100644 (file)
@@ -48,7 +48,11 @@ main()
     test(fe);
   }
   {
-    FE_Q<2> fe(QGaussLobatto<1>(4));
+    FE_Q<2> fe(3);
+    test(fe);
+  }
+  {
+    FE_Q<2> fe(QIterated<1>(QTrapez<1>(),3));
     test(fe);
   }
   {
@@ -66,11 +70,13 @@ main()
     FE_DGQArbitraryNodes<2> fe(quadrature);
     test(fe);
   }
+  {
+    QIterated<1> quadrature(QTrapez<1>(), 3);
+    FE_DGQArbitraryNodes<2> fe(quadrature);
+    test(fe);
+  }
 
 
 
   return 0;
 }
-
-
-
index 4a276ef96610d66ef6d1a9c29f2afcc09779e7a3..85d0cadbff2e7cd92c3be10ef05476c157fe82be 100644 (file)
@@ -65,11 +65,13 @@ main()
     FE_DGQArbitraryNodes<2,3> fe(quadrature);
     test(fe);
   }
+  {
+    QIterated<1> quadrature(QTrapez<1>(), 3);
+    FE_DGQArbitraryNodes<2,3> fe(quadrature);
+    test(fe);
+  }
 
 
 
   return 0;
 }
-
-
-
index 89544b7cbd35b03e51710db0a25c26e8675d232d..a19342d576366ab13d60378384546f46b3a5bb83 100644 (file)
@@ -92,12 +92,14 @@ check(const FiniteElement<dim, spacedim> &fe,
 
           for (unsigned int j=0; j<dpc; ++j)
             {
-              const unsigned int add =(fe.restriction_is_additive(j))?1:0;
+              const bool add = fe.restriction_is_additive(j);
               for (unsigned int i=0; i<dpc; ++i)
                 {
                   prolongation_global(ldi[i],j)=prolongation_local(i,j);
-                  restriction_global(j,ldi[i])*=add;
-                  restriction_global(j,ldi[i])+=restriction_local(j,i);
+                  if (add)
+                    restriction_global(j,ldi[i])+=restriction_local(j,i);
+                  else if (restriction_local(j,i) != 0)
+                    restriction_global(j,ldi[i]) =restriction_local(j,i);
                 }
             }
         }
index 6495a5aade95480de17c2bb5d934edea01208323..6d8e3dda3f1dbdd5dd096713e2901c6ae286d788 100644 (file)
@@ -153,8 +153,9 @@ void test ()
     // FE_Q
     new FE_Q<dim>(1),
     new FE_Q<dim>(2),
-    (dim<3 ? new FE_Q<dim>(3) : 0),
+    new FE_Q<dim>(3),
     (dim<2 ? new FE_Q<dim>(4) : 0),
+    (dim<2 ? new FE_Q<dim>(5) : 0),
 
     // FE_DGQ
     new FE_DGQ<dim>(0),
@@ -254,6 +255,3 @@ main()
 
   return 0;
 }
-
-
-
index d39d4c5642845b6013e2b5bf1535add207b46405..c34ac0dc52770bba74f1e5344ad88f15f18e6874 100644 (file)
@@ -1,6 +1,6 @@
 // ---------------------------------------------------------------------
 //
-// Copyright (C) 2013 - 2015 by the deal.II authors
+// Copyright (C) 2013 - 2016 by the deal.II authors
 //
 // This file is part of the deal.II library.
 //
@@ -149,31 +149,32 @@ int main ()
 
   {
     // iterations taken from results at tolerance 1e-9
-    deallog.threshold_double(1.e-9);
+    deallog.threshold_double(1.e-8);
     deallog.push("2d");
     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_Q<2>(4), 56);
+    test<2,4>(FE_Q<2>(QIterated<1>(QTrapez<1>(),4)), 75);
     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);
+    test<2,6>(FE_Q<2>(6), 77);
+    test<2,6>(FE_Q<2>(QIterated<1>(QTrapez<1>(),6)), 161);
+    test<2,6>(FE_DGQ<2>(6), 32);
+    test<2,6>(FE_DGQArbitraryNodes<2>(QIterated<1>(QTrapez<1>(),6)), 38);
+    test<2,10>(FE_Q<2>(10), 108);
+    test<2,10>(FE_Q<2>(QIterated<1>(QTrapez<1>(),10)), 782);
+    test<2,10>(FE_DGQ<2>(10), 70);
+    test<2,10>(FE_DGQArbitraryNodes<2>(QIterated<1>(QTrapez<1>(),10)), 118);
+    test<2,16>(FE_Q<2>(16), 156);
+    test<2,25>(FE_Q<2>(25), 200);
     deallog.pop();
     deallog.push("3d");
     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);
+    test<3,5>(FE_Q<3>(5), 187);
+    test<3,5>(FE_Q<3>(QIterated<1>(QTrapez<1>(),5)), 494);
     deallog.pop();
   }
 }
-
-
index 2c1cfe56199d9ca18466d2f53d78f3904a12b42e..99043dde5bcf62bb5a38d75c3588cf312c8b244c 100644 (file)
@@ -32,7 +32,7 @@ void check(const unsigned int fe_degree)
 {
   deallog.threshold_double(std::max(5e2*(double)std::numeric_limits<Number>::epsilon(),
                                     1e-11));
-  FE_Q<dim> fe(QGaussLobatto<1>(fe_degree+1));
+  FE_Q<dim> fe(fe_degree);
   deallog << "FE: " << fe.get_name() << std::endl;
 
   // run a few different sizes...
index 5bf939a659907e7c10b94181256458384097927f..475eadf04c7f2a7244714c412a47bb3400312fcd 100644 (file)
@@ -33,7 +33,7 @@ void check(const unsigned int fe_degree)
 {
   deallog.threshold_double(std::max(5e2*(double)std::numeric_limits<Number>::epsilon(),
                                     1e-11));
-  FE_Q<dim> fe(QGaussLobatto<1>(fe_degree+1));
+  FE_Q<dim> fe(fe_degree);
   deallog << "FE: " << fe.get_name() << std::endl;
 
   // run a few different sizes...
index 47f5d0989cddcee1edd3b3bd7657144c962e3705..4ae35320e21cb0c9ae99b0eee6801ea7894357d5 100644 (file)
@@ -34,7 +34,7 @@ void check(const unsigned int fe_degree)
 {
   deallog.threshold_double(std::max(5e2*(double)std::numeric_limits<Number>::epsilon(),
                                     1e-11));
-  FE_Q<dim> fe(QGaussLobatto<1>(fe_degree+1));
+  FE_Q<dim> fe(fe_degree);
   deallog << "FE: " << fe.get_name() << std::endl;
 
   // run a few different sizes...
index 8c2ed4e9025b84a74d12d988883cf436fc026df2..c85ea33c289a6f5d2c33dcc173f60fb814d9a406 100644 (file)
@@ -33,7 +33,7 @@ void check(const unsigned int fe_degree)
 {
   deallog.threshold_double(std::max(5e2*(double)std::numeric_limits<Number>::epsilon(),
                                     1e-11));
-  FE_DGQArbitraryNodes<dim> fe(QGaussLobatto<1>(fe_degree+1));
+  FE_DGQ<dim> fe(fe_degree);
   deallog << "FE: " << fe.get_name() << std::endl;
 
   // run a few different sizes...
index d6bee32ffcb4d5e3eccdb648fb8519b98aa090dc..7fdda041d57eb0b709e242e34ec95dd9a465548c 100644 (file)
@@ -33,7 +33,7 @@ void check(const unsigned int fe_degree)
 {
   deallog.threshold_double(std::max(5e2*(double)std::numeric_limits<Number>::epsilon(),
                                     1e-11));
-  FE_DGQArbitraryNodes<dim> fe(QGaussLobatto<1>(fe_degree+1));
+  FE_DGQ<dim> fe(fe_degree);
   deallog << "FE: " << fe.get_name() << std::endl;
 
   // run a few different sizes...
index f9409a5c710d8efc4d79a15aa6660871501c3394..acb60f93fd0406c6990fc2a4d9945f639b244129 100644 (file)
@@ -35,7 +35,7 @@ void check(const unsigned int fe_degree)
 {
   deallog.threshold_double(std::max(5e2*(double)std::numeric_limits<Number>::epsilon(),
                                     1e-11));
-  FESystem<dim> fe (FE_Q<dim>(QGaussLobatto<1>(fe_degree+1)), 2);
+  FESystem<dim> fe (FE_Q<dim>(fe_degree), 2);
   deallog << "FE: " << fe.get_name() << std::endl;
 
   // run a few different sizes...
index 5731b79160fade7d1c06fbeb4665a4f19817f4d8..b6b4e1af61ae63f0bd543eb4bb3245364611614c 100644 (file)
@@ -276,7 +276,7 @@ void Step4<dim>::solve ()
     check_solver_within_range(
       solver.solve (system_matrix, solution, system_rhs,
                     preconditioner),
-      solver_control.last_step(), 31, 34);
+      solver_control.last_step(), 25, 34);
   }
   deallog.pop();
 

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.