From: Daniel Arndt Date: Sat, 2 Sep 2017 13:49:51 +0000 (+0200) Subject: Update tests X-Git-Tag: v9.0.0-rc1~1130^2~1 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c249b5c0ad913de1b992f3dd36300e0d254ebf97;p=dealii.git Update tests --- diff --git a/tests/lac/gmres_reorthogonalize_01.cc b/tests/lac/gmres_reorthogonalize_01.cc index 9f6bf86198..0d54f59f5a 100644 --- a/tests/lac/gmres_reorthogonalize_01.cc +++ b/tests/lac/gmres_reorthogonalize_01.cc @@ -15,7 +15,8 @@ // tests that GMRES builds an orthonormal basis properly for a few difficult -// test matrices +// test matrices. In particular, this test monitors when re-orthogonalization +// kicks in. #include "../tests.h" #include @@ -26,7 +27,7 @@ template -void test (unsigned int variant) +void test (unsigned int variant, unsigned int min_convergence_steps) { const unsigned int n = 64; Vector rhs(n), sol(n); @@ -70,30 +71,38 @@ void test (unsigned int variant) data.max_n_tmp_vectors = 80; SolverGMRES > solver(control, data); - solver.solve(matrix, sol, rhs, PreconditionIdentity()); + auto print_re_orthogonalization = + [](int accumulated_iterations) + { + deallog.get_file_stream() << "Re-orthogonalization enabled at step " + << accumulated_iterations << std::endl; + }; + solver.connect_re_orthogonalization_slot(print_re_orthogonalization); + + check_solver_within_range + (solver.solve(matrix, sol, rhs, PreconditionIdentity()), + control.last_step(), min_convergence_steps, min_convergence_steps+2); deallog.pop(); } int main() { - std::ofstream logfile("output"); - deallog << std::setprecision(3); - deallog.attach(logfile); + initlog(); deallog.push("double"); - test(0); - test(1); - test(2); - test(3); - test(4); - test(5); + test(0, 56); + test(1, 64); + test(2, 56); + test(3, 64); + test(4, 56); + test(5, 64); deallog.pop(); deallog.push("float"); - test(0); - test(1); - test(2); - test(3); + test(0, 36); + test(1, 64); + test(2, 36); + test(3, 64); deallog.pop(); } diff --git a/tests/lac/gmres_reorthogonalize_01.debug.output b/tests/lac/gmres_reorthogonalize_01.debug.output index 9f9b65c3c1..5bb149d68a 100644 --- a/tests/lac/gmres_reorthogonalize_01.debug.output +++ b/tests/lac/gmres_reorthogonalize_01.debug.output @@ -1,26 +1,16 @@ -DEAL:double:0:GMRES::Starting value 8.00 -DEAL:double:0:GMRES::Convergence step 57 value 1.62e-14 -DEAL:double:1:GMRES::Starting value 8.00 -DEAL:double:1:GMRES::Re-orthogonalization enabled at step 65 -DEAL:double:1:GMRES::Convergence step 65 value 1.04e-23 -DEAL:double:2:GMRES::Starting value 8.00 -DEAL:double:2:GMRES::Convergence step 57 value 1.72e-14 -DEAL:double:3:GMRES::Starting value 8.00 -DEAL:double:3:GMRES::Re-orthogonalization enabled at step 65 -DEAL:double:3:GMRES::Convergence step 65 value 2.56e-24 -DEAL:double:4:GMRES::Starting value 8.00 -DEAL:double:4:GMRES::Convergence step 57 value 1.59e-14 -DEAL:double:5:GMRES::Starting value 8.00 -DEAL:double:5:GMRES::Re-orthogonalization enabled at step 65 -DEAL:double:5:GMRES::Convergence step 65 value 1.96e-24 -DEAL:float:0:GMRES::Starting value 8.00 -DEAL:float:0:GMRES::Convergence step 37 value 7.73e-06 -DEAL:float:1:GMRES::Starting value 8.00 -DEAL:float:1:GMRES::Re-orthogonalization enabled at step 65 -DEAL:float:1:GMRES::Convergence step 65 value 1.11e-05 -DEAL:float:2:GMRES::Starting value 8.00 -DEAL:float:2:GMRES::Convergence step 37 value 6.87e-06 -DEAL:float:3:GMRES::Starting value 8.00 -DEAL:float:3:GMRES::Re-orthogonalization enabled at step 65 -DEAL:float:3:GMRES::Convergence step 66 value 3.27e-10 +DEAL:double:0::Solver stopped within 56 - 58 iterations +Re-orthogonalization enabled at step 65 +DEAL:double:1::Solver stopped within 64 - 66 iterations +DEAL:double:2::Solver stopped within 56 - 58 iterations +Re-orthogonalization enabled at step 65 +DEAL:double:3::Solver stopped within 64 - 66 iterations +DEAL:double:4::Solver stopped within 56 - 58 iterations +Re-orthogonalization enabled at step 65 +DEAL:double:5::Solver stopped within 64 - 66 iterations +DEAL:float:0::Solver stopped within 36 - 38 iterations +Re-orthogonalization enabled at step 65 +DEAL:float:1::Solver stopped within 64 - 66 iterations +DEAL:float:2::Solver stopped within 36 - 38 iterations +Re-orthogonalization enabled at step 65 +DEAL:float:3::Solver stopped within 64 - 66 iterations diff --git a/tests/lac/gmres_reorthogonalize_02.cc b/tests/lac/gmres_reorthogonalize_02.cc index 4a44534108..cdc5fe4ffb 100644 --- a/tests/lac/gmres_reorthogonalize_02.cc +++ b/tests/lac/gmres_reorthogonalize_02.cc @@ -45,6 +45,13 @@ void test () data.max_n_tmp_vectors = 202; SolverGMRES > solver(control, data); + auto print_re_orthogonalization = + [](int accumulated_iterations) + { + deallog.get_file_stream() << "Re-orthogonalization enabled at step " + << accumulated_iterations << std::endl; + }; + solver.connect_re_orthogonalization_slot(print_re_orthogonalization); solver.solve(matrix, sol, rhs, PreconditionIdentity()); } diff --git a/tests/lac/gmres_reorthogonalize_03.cc b/tests/lac/gmres_reorthogonalize_03.cc index 523f0a6604..dc48dc6560 100644 --- a/tests/lac/gmres_reorthogonalize_03.cc +++ b/tests/lac/gmres_reorthogonalize_03.cc @@ -70,6 +70,13 @@ void test (unsigned int variant) data.force_re_orthogonalization = true; SolverGMRES > solver(control, data); + auto print_re_orthogonalization = + [](int accumulated_iterations) + { + deallog.get_file_stream() << "Re-orthogonalization enabled at step " + << accumulated_iterations << std::endl; + }; + solver.connect_re_orthogonalization_slot(print_re_orthogonalization); solver.solve(matrix, sol, rhs, PreconditionIdentity()); deallog.pop(); diff --git a/tests/lac/gmres_reorthogonalize_04.cc b/tests/lac/gmres_reorthogonalize_04.cc index c634180690..fa8d5f3234 100644 --- a/tests/lac/gmres_reorthogonalize_04.cc +++ b/tests/lac/gmres_reorthogonalize_04.cc @@ -73,6 +73,13 @@ void test () data.max_n_tmp_vectors = 202; SolverGMRES > solver(control, data); + auto print_re_orthogonalization = + [](int accumulated_iterations) + { + deallog.get_file_stream() << "Re-orthogonalization enabled at step " + << accumulated_iterations << std::endl; + }; + solver.connect_re_orthogonalization_slot(print_re_orthogonalization); solver.solve(matrix, sol, rhs, PreconditionIdentity()); } diff --git a/tests/lac/gmres_reorthogonalize_05.cc b/tests/lac/gmres_reorthogonalize_05.cc index 284981f46d..13241a1518 100644 --- a/tests/lac/gmres_reorthogonalize_05.cc +++ b/tests/lac/gmres_reorthogonalize_05.cc @@ -71,6 +71,13 @@ void test () data.force_re_orthogonalization = true; SolverGMRES > solver(control, data); + auto print_re_orthogonalization = + [](int accumulated_iterations) + { + deallog.get_file_stream() << "Re-orthogonalization enabled at step " + << accumulated_iterations << std::endl; + }; + solver.connect_re_orthogonalization_slot(print_re_orthogonalization); solver.solve(matrix, sol, rhs, PreconditionIdentity()); } diff --git a/tests/lac/solver.output b/tests/lac/solver.output index ef1e643dcb..8e9b4b983b 100644 --- a/tests/lac/solver.output +++ b/tests/lac/solver.output @@ -1,44 +1,44 @@ DEAL::Size 4 Unknowns 9 -DEAL::SOR-diff:0 +DEAL::SOR-diff:0.000 DEAL:no-fail:cg::Starting value 3.000 -DEAL:no-fail:cg::Convergence step 3 value 0 +DEAL:no-fail:cg::Convergence step 3 value 4.807e-17 DEAL:no-fail:Bicgstab::Starting value 3.000 -DEAL:no-fail:Bicgstab::Convergence step 3 value 0 +DEAL:no-fail:Bicgstab::Convergence step 3 value 5.998e-18 DEAL:no-fail:GMRES::Starting value 3.000 -DEAL:no-fail:GMRES::Convergence step 3 value 0 +DEAL:no-fail:GMRES::Convergence step 3 value 1.110e-16 DEAL:no-fail:GMRES::Starting value 3.000 -DEAL:no-fail:GMRES::Convergence step 3 value 0 +DEAL:no-fail:GMRES::Convergence step 3 value 1.110e-16 DEAL:no-fail:QMRS::Starting value 3.000 -DEAL:no-fail:QMRS::Convergence step 3 value 0 +DEAL:no-fail:QMRS::Convergence step 3 value 9.615e-17 DEAL:no-fail:FIRE::Starting value 9.000 DEAL:no-fail:FIRE::Convergence step 38 value 0.0002184 DEAL:no:Richardson::Starting value 3.000 DEAL:no:Richardson::Convergence step 24 value 0.0007118 DEAL:no:cg::Starting value 3.000 -DEAL:no:cg::Convergence step 3 value 0 +DEAL:no:cg::Convergence step 3 value 4.807e-17 DEAL:no:Bicgstab::Starting value 3.000 -DEAL:no:Bicgstab::Convergence step 3 value 0 +DEAL:no:Bicgstab::Convergence step 3 value 5.998e-18 DEAL:no:GMRES::Starting value 3.000 -DEAL:no:GMRES::Convergence step 3 value 0 +DEAL:no:GMRES::Convergence step 3 value 1.110e-16 DEAL:no:GMRES::Starting value 3.000 -DEAL:no:GMRES::Convergence step 3 value 0 +DEAL:no:GMRES::Convergence step 3 value 1.110e-16 DEAL:no:QMRS::Starting value 3.000 -DEAL:no:QMRS::Convergence step 3 value 0 +DEAL:no:QMRS::Convergence step 3 value 9.615e-17 DEAL:no:FIRE::Starting value 9.000 DEAL:no:FIRE::Convergence step 38 value 0.0002184 DEAL:rich:Richardson::Starting value 3.000 DEAL:rich:Richardson::Convergence step 42 value 0.0008696 DEAL:rich:cg::Starting value 3.000 -DEAL:rich:cg::Convergence step 3 value 0 +DEAL:rich:cg::Convergence step 3 value 3.102e-16 DEAL:rich:Bicgstab::Starting value 3.000 -DEAL:rich:Bicgstab::Convergence step 3 value 0 +DEAL:rich:Bicgstab::Convergence step 3 value 7.254e-18 DEAL:rich:GMRES::Starting value 1.800 -DEAL:rich:GMRES::Convergence step 3 value 0 +DEAL:rich:GMRES::Convergence step 3 value 6.029e-16 DEAL:rich:GMRES::Starting value 3.000 -DEAL:rich:GMRES::Convergence step 3 value 0 +DEAL:rich:GMRES::Convergence step 3 value 1.078e-15 DEAL:rich:QMRS::Starting value 3.000 -DEAL:rich:QMRS::Convergence step 3 value 0 +DEAL:rich:QMRS::Convergence step 3 value 7.195e-16 DEAL:rich:FIRE::Starting value 9.000 DEAL:rich:FIRE::Convergence step 32 value 0.0009708 DEAL:ssor:RichardsonT::Starting value 3.000 @@ -65,13 +65,11 @@ DEAL:sor:cg::Starting value 3.000 DEAL:sor:cg::Failure step 100 value 0.2585 DEAL:sor::Exception: SolverControl::NoConvergence (it, res) DEAL:sor:Bicgstab::Starting value 3.000 -DEAL:sor:Bicgstab::Convergence step 5 value 0 +DEAL:sor:Bicgstab::Convergence step 5 value 6.247e-18 DEAL:sor:GMRES::Starting value 1.462 -DEAL:sor:GMRES::Re-orthogonalization enabled at step 5 -DEAL:sor:GMRES::Convergence step 5 value 0 +DEAL:sor:GMRES::Convergence step 5 value 7.914e-19 DEAL:sor:GMRES::Starting value 3.000 -DEAL:sor:GMRES::Re-orthogonalization enabled at step 5 -DEAL:sor:GMRES::Convergence step 5 value 0 +DEAL:sor:GMRES::Convergence step 5 value 6.144e-18 DEAL:sor:FIRE::Starting value 9.000 DEAL:sor:FIRE::Convergence step 51 value 0.0004993 DEAL:psor:RichardsonT::Starting value 3.000 @@ -90,7 +88,7 @@ DEAL:psor:GMRES::Convergence step 6 value 0.0004455 DEAL:psor:FIRE::Starting value 9.000 DEAL:psor:FIRE::Convergence step 45 value 0.0009217 DEAL::Size 12 Unknowns 121 -DEAL::SOR-diff:0 +DEAL::SOR-diff:0.000 DEAL:no-fail:cg::Starting value 11.00 DEAL:no-fail:cg::Failure step 10 value 0.1496 DEAL:no-fail::Exception: SolverControl::NoConvergence (it, res)