From 1705b90b9fb9caf0fedc2f2ca218c20164931cb8 Mon Sep 17 00:00:00 2001 From: guido Date: Wed, 29 May 2002 11:14:40 +0000 Subject: [PATCH] test for failed iterations, too git-svn-id: https://svn.dealii.org/trunk@5926 0785d39b-7218-0410-832d-ea1e28bc413d --- tests/lac/solver.cc | 32 +++++++++++++++++++++----------- tests/lac/solver.checked | 32 ++++++++++++++++++++++++++------ 2 files changed, 47 insertions(+), 17 deletions(-) diff --git a/tests/lac/solver.cc b/tests/lac/solver.cc index 9d6597563f..f552006463 100644 --- a/tests/lac/solver.cc +++ b/tests/lac/solver.cc @@ -36,7 +36,14 @@ check_method( SOLVER& solver, const MATRIX& A, { u = 0.; f = 1.; - solver.solve(A,u,f,P); + try + { + solver.solve(A,u,f,P); + } + catch (std::exception& e) + { + deallog << e.what() << std::endl; + } } int main() @@ -51,7 +58,7 @@ int main() SolverControl control(100, 1.e-3); SolverControl verbose_control(100, 1.e-3, true); SolverCG<> cg(control, mem); - SolverGMRES<> gmres(control, mem,20); + SolverGMRES<> gmres(control, mem, 8); SolverBicgstab<> bicgstab(control, mem); SolverRichardson<> rich(control, mem); SolverQMRS<> qmrs(control, mem); @@ -93,6 +100,17 @@ int main() try { + deallog.push("no-fail"); + + control.set_max_steps(10); + check_method(cg,A,u,f,prec_no); + check_method(bicgstab,A,u,f,prec_no); + check_method(gmres,A,u,f,prec_no); + check_method(qmrs,A,u,f,prec_no); + control.set_max_steps(100); + + deallog.pop(); + deallog.push("no"); check_method(cg,A,u,f,prec_no); @@ -115,15 +133,7 @@ int main() deallog.push("sor"); check_method(rich,A,u,f,prec_sor); - try - { - check_method(cg,A,u,f,prec_sor); - } - catch (std::exception& e) - { - deallog << e.what() << std::endl; - } - + check_method(cg,A,u,f,prec_sor); check_method(bicgstab,A,u,f,prec_sor); check_method(gmres,A,u,f,prec_sor); diff --git a/tests/lac/solver.checked b/tests/lac/solver.checked index 708c247ba7..5ac7108927 100644 --- a/tests/lac/solver.checked +++ b/tests/lac/solver.checked @@ -1,6 +1,14 @@ DEAL::Size 4 Unknowns 9 DEAL::SOR-diff:0.00 +DEAL:no-fail:cg::Starting +DEAL:no-fail:cg::Convergence step 3 +DEAL:no-fail:Bicgstab::Starting +DEAL:no-fail:Bicgstab::Convergence step 3 +DEAL:no-fail:GMRES::Starting +DEAL:no-fail:GMRES::Convergence step 3 +DEAL:no-fail:QMRS::Starting +DEAL:no-fail:QMRS::Convergence step 3 DEAL:no:cg::Starting DEAL:no:cg::Convergence step 3 DEAL:no:Bicgstab::Starting @@ -23,19 +31,31 @@ DEAL:sor:Richardson::Starting DEAL:sor:Richardson::Convergence step 7 DEAL:sor:cg::Starting DEAL:sor:cg::Failure step 100 -DEAL:sor::Iterative method reported convergence failure in step 100 with residual 0.258509 +DEAL:sor::Iterative method reported convergence failure in step 100 DEAL:sor:Bicgstab::Starting DEAL:sor:Bicgstab::Convergence step 5 DEAL:sor:GMRES::Starting DEAL:sor:GMRES::Convergence step 5 DEAL::Size 12 Unknowns 121 DEAL::SOR-diff:0.00 +DEAL:no-fail:cg::Starting +DEAL:no-fail:cg::Failure step 10 +DEAL:no-fail::Iterative method reported convergence failure in step 10 +DEAL:no-fail:Bicgstab::Starting +DEAL:no-fail:Bicgstab::Failure step 10 +DEAL:no-fail::Iterative method reported convergence failure in step 10 +DEAL:no-fail:GMRES::Starting +DEAL:no-fail:GMRES::Failure step 10 +DEAL:no-fail::Iterative method reported convergence failure in step 10 +DEAL:no-fail:QMRS::Starting +DEAL:no-fail:QMRS::Failure step 10 +DEAL:no-fail::Iterative method reported convergence failure in step 10 DEAL:no:cg::Starting DEAL:no:cg::Convergence step 15 DEAL:no:Bicgstab::Starting DEAL:no:Bicgstab::Convergence step 11 DEAL:no:GMRES::Starting -DEAL:no:GMRES::Convergence step 15 +DEAL:no:GMRES::Convergence step 43 DEAL:no:QMRS::Starting DEAL:no:QMRS::Convergence step 16 DEAL:ssor:Richardson::Starting @@ -52,10 +72,10 @@ DEAL:sor:Richardson::Starting DEAL:sor:Richardson::Convergence step 88 DEAL:sor:cg::Starting DEAL:sor:cg::Failure step 100 -DEAL:sor::Iterative method reported convergence failure in step 100 with residual 5.64329 +DEAL:sor::Iterative method reported convergence failure in step 100 DEAL:sor:Bicgstab::Starting DEAL:sor:Bicgstab::Convergence step 14 DEAL:sor:GMRES::Starting -DEAL:sor:GMRES::Convergence step 20 -DEAL::GrowingVectorMemory:Overall allocated vectors: 163 -DEAL::GrowingVectorMemory:Maximum allocated vectors: 20 +DEAL:sor:GMRES::Convergence step 23 +DEAL::GrowingVectorMemory:Overall allocated vectors: 188 +DEAL::GrowingVectorMemory:Maximum allocated vectors: 8 -- 2.39.5