From 62d4da7fe2b1fb28ab3fa0c54ee367055d85265e Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Tue, 5 Apr 2016 14:51:44 +0200 Subject: [PATCH] Adjust tests to better cover Gauss-Lobatto and equidistant points --- tests/bits/point_difference_01.cc | 4 +-- tests/bits/point_difference_02.cc | 4 +-- tests/bits/point_value_01.cc | 4 +-- tests/bits/point_value_02.cc | 4 +-- tests/codim_one/error_estimator_01.cc | 2 +- tests/fe/fe_data_test.cc | 4 +-- tests/fe/fe_tools_01.cc | 5 ++- tests/fe/get_name_01.cc | 14 ++++++--- tests/fe/get_name_02.cc | 8 +++-- tests/fe/restrict_prolongation_01.cc | 8 +++-- tests/fe/up_and_down.cc | 6 ++-- .../estimate_condition_number_mass.cc | 31 ++++++++++--------- tests/multigrid/transfer_matrix_free_01.cc | 2 +- tests/multigrid/transfer_matrix_free_02.cc | 2 +- tests/multigrid/transfer_matrix_free_03.cc | 2 +- tests/multigrid/transfer_matrix_free_04.cc | 2 +- tests/multigrid/transfer_matrix_free_05.cc | 2 +- tests/multigrid/transfer_matrix_free_06.cc | 2 +- tests/trilinos/precondition_muelu_q_iso_q1.cc | 2 +- 19 files changed, 60 insertions(+), 48 deletions(-) diff --git a/tests/bits/point_difference_01.cc b/tests/bits/point_difference_01.cc index 0df9665a58..b74b69b163 100644 --- a/tests/bits/point_difference_01.cc +++ b/tests/bits/point_difference_01.cc @@ -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(), 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()); } } diff --git a/tests/bits/point_difference_02.cc b/tests/bits/point_difference_02.cc index 517cbd22fb..b6d8ebf93c 100644 --- a/tests/bits/point_difference_02.cc +++ b/tests/bits/point_difference_02.cc @@ -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(), 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()); } } diff --git a/tests/bits/point_value_01.cc b/tests/bits/point_value_01.cc index d834ade876..46f0b815b4 100644 --- a/tests/bits/point_value_01.cc +++ b/tests/bits/point_value_01.cc @@ -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()); } } diff --git a/tests/bits/point_value_02.cc b/tests/bits/point_value_02.cc index f80c6ad198..daf1bfebc8 100644 --- a/tests/bits/point_value_02.cc +++ b/tests/bits/point_value_02.cc @@ -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()); } } diff --git a/tests/codim_one/error_estimator_01.cc b/tests/codim_one/error_estimator_01.cc index 340af0c321..743b06ee63 100644 --- a/tests/codim_one/error_estimator_01.cc +++ b/tests/codim_one/error_estimator_01.cc @@ -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); diff --git a/tests/fe/fe_data_test.cc b/tests/fe/fe_data_test.cc index 573db61451..9b72b18ff3 100644 --- a/tests/fe/fe_data_test.cc +++ b/tests/fe/fe_data_test.cc @@ -115,9 +115,9 @@ void test_fe_datas() deallog << (*fe_datas.rbegin())->get_name() << std::endl; fe_datas.push_back(new FE_DGQ (2)); deallog << (*fe_datas.rbegin())->get_name() << std::endl; - fe_datas.push_back(new FE_DGQ (4)); + fe_datas.push_back(new FE_DGQArbitraryNodes (QIterated<1>(QTrapez<1>(),4))); deallog << (*fe_datas.rbegin())->get_name() << std::endl; - fe_datas.push_back(new FE_DGQArbitraryNodes (QGaussLobatto<1>(5))); + fe_datas.push_back(new FE_DGQ (4)); deallog << (*fe_datas.rbegin())->get_name() << std::endl; fe_datas.push_back(new FE_DGQArbitraryNodes (QGauss<1>(3))); deallog << (*fe_datas.rbegin())->get_name() << std::endl; diff --git a/tests/fe/fe_tools_01.cc b/tests/fe/fe_tools_01.cc index 3a69402399..d9f5d90828 100644 --- a/tests/fe/fe_tools_01.cc +++ b/tests/fe/fe_tools_01.cc @@ -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(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(2)^dim-FE_DGQ(1)]"); test_fe<2>("FESystem<2>[FE_Q<2>(2)^dim-FE_DGQ<2>(1)]"); diff --git a/tests/fe/get_name_01.cc b/tests/fe/get_name_01.cc index d2701d7d38..0ddc7d7fa5 100644 --- a/tests/fe/get_name_01.cc +++ b/tests/fe/get_name_01.cc @@ -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; } - - - diff --git a/tests/fe/get_name_02.cc b/tests/fe/get_name_02.cc index 4a276ef966..85d0cadbff 100644 --- a/tests/fe/get_name_02.cc +++ b/tests/fe/get_name_02.cc @@ -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; } - - - diff --git a/tests/fe/restrict_prolongation_01.cc b/tests/fe/restrict_prolongation_01.cc index 89544b7cbd..a19342d576 100644 --- a/tests/fe/restrict_prolongation_01.cc +++ b/tests/fe/restrict_prolongation_01.cc @@ -92,12 +92,14 @@ check(const FiniteElement &fe, for (unsigned int j=0; j(1), new FE_Q(2), - (dim<3 ? new FE_Q(3) : 0), + new FE_Q(3), (dim<2 ? new FE_Q(4) : 0), + (dim<2 ? new FE_Q(5) : 0), // FE_DGQ new FE_DGQ(0), @@ -254,6 +255,3 @@ main() return 0; } - - - diff --git a/tests/matrix_free/estimate_condition_number_mass.cc b/tests/matrix_free/estimate_condition_number_mass.cc index d39d4c5642..c34ac0dc52 100644 --- a/tests/matrix_free/estimate_condition_number_mass.cc +++ b/tests/matrix_free/estimate_condition_number_mass.cc @@ -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(); } } - - diff --git a/tests/multigrid/transfer_matrix_free_01.cc b/tests/multigrid/transfer_matrix_free_01.cc index 2c1cfe5619..99043dde5b 100644 --- a/tests/multigrid/transfer_matrix_free_01.cc +++ b/tests/multigrid/transfer_matrix_free_01.cc @@ -32,7 +32,7 @@ void check(const unsigned int fe_degree) { deallog.threshold_double(std::max(5e2*(double)std::numeric_limits::epsilon(), 1e-11)); - FE_Q fe(QGaussLobatto<1>(fe_degree+1)); + FE_Q fe(fe_degree); deallog << "FE: " << fe.get_name() << std::endl; // run a few different sizes... diff --git a/tests/multigrid/transfer_matrix_free_02.cc b/tests/multigrid/transfer_matrix_free_02.cc index 5bf939a659..475eadf04c 100644 --- a/tests/multigrid/transfer_matrix_free_02.cc +++ b/tests/multigrid/transfer_matrix_free_02.cc @@ -33,7 +33,7 @@ void check(const unsigned int fe_degree) { deallog.threshold_double(std::max(5e2*(double)std::numeric_limits::epsilon(), 1e-11)); - FE_Q fe(QGaussLobatto<1>(fe_degree+1)); + FE_Q fe(fe_degree); deallog << "FE: " << fe.get_name() << std::endl; // run a few different sizes... diff --git a/tests/multigrid/transfer_matrix_free_03.cc b/tests/multigrid/transfer_matrix_free_03.cc index 47f5d0989c..4ae35320e2 100644 --- a/tests/multigrid/transfer_matrix_free_03.cc +++ b/tests/multigrid/transfer_matrix_free_03.cc @@ -34,7 +34,7 @@ void check(const unsigned int fe_degree) { deallog.threshold_double(std::max(5e2*(double)std::numeric_limits::epsilon(), 1e-11)); - FE_Q fe(QGaussLobatto<1>(fe_degree+1)); + FE_Q fe(fe_degree); deallog << "FE: " << fe.get_name() << std::endl; // run a few different sizes... diff --git a/tests/multigrid/transfer_matrix_free_04.cc b/tests/multigrid/transfer_matrix_free_04.cc index 8c2ed4e902..c85ea33c28 100644 --- a/tests/multigrid/transfer_matrix_free_04.cc +++ b/tests/multigrid/transfer_matrix_free_04.cc @@ -33,7 +33,7 @@ void check(const unsigned int fe_degree) { deallog.threshold_double(std::max(5e2*(double)std::numeric_limits::epsilon(), 1e-11)); - FE_DGQArbitraryNodes fe(QGaussLobatto<1>(fe_degree+1)); + FE_DGQ fe(fe_degree); deallog << "FE: " << fe.get_name() << std::endl; // run a few different sizes... diff --git a/tests/multigrid/transfer_matrix_free_05.cc b/tests/multigrid/transfer_matrix_free_05.cc index d6bee32ffc..7fdda041d5 100644 --- a/tests/multigrid/transfer_matrix_free_05.cc +++ b/tests/multigrid/transfer_matrix_free_05.cc @@ -33,7 +33,7 @@ void check(const unsigned int fe_degree) { deallog.threshold_double(std::max(5e2*(double)std::numeric_limits::epsilon(), 1e-11)); - FE_DGQArbitraryNodes fe(QGaussLobatto<1>(fe_degree+1)); + FE_DGQ fe(fe_degree); deallog << "FE: " << fe.get_name() << std::endl; // run a few different sizes... diff --git a/tests/multigrid/transfer_matrix_free_06.cc b/tests/multigrid/transfer_matrix_free_06.cc index f9409a5c71..acb60f93fd 100644 --- a/tests/multigrid/transfer_matrix_free_06.cc +++ b/tests/multigrid/transfer_matrix_free_06.cc @@ -35,7 +35,7 @@ void check(const unsigned int fe_degree) { deallog.threshold_double(std::max(5e2*(double)std::numeric_limits::epsilon(), 1e-11)); - FESystem fe (FE_Q(QGaussLobatto<1>(fe_degree+1)), 2); + FESystem fe (FE_Q(fe_degree), 2); deallog << "FE: " << fe.get_name() << std::endl; // run a few different sizes... diff --git a/tests/trilinos/precondition_muelu_q_iso_q1.cc b/tests/trilinos/precondition_muelu_q_iso_q1.cc index 5731b79160..b6b4e1af61 100644 --- a/tests/trilinos/precondition_muelu_q_iso_q1.cc +++ b/tests/trilinos/precondition_muelu_q_iso_q1.cc @@ -276,7 +276,7 @@ void Step4::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(); -- 2.39.5