From: Guido Kanschat Date: Wed, 25 Apr 2001 09:58:32 +0000 (+0000) Subject: exception handled X-Git-Tag: v8.0.0~19302 X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b2cd18ef33513e50e6e86cfd72bdea17be52cc47;p=dealii.git exception handled git-svn-id: https://svn.dealii.org/trunk@4485 0785d39b-7218-0410-832d-ea1e28bc413d --- diff --git a/tests/deal.II/mg.cc b/tests/deal.II/mg.cc index 3d63864fbd..5b687d48dd 100644 --- a/tests/deal.II/mg.cc +++ b/tests/deal.II/mg.cc @@ -2,7 +2,7 @@ // $Id$ // Version: $Name$ // -// Copyright (C) 1998, 1999, 2000 by the deal.II authors +// Copyright (C) 1998, 1999, 2000, 2001 by the deal.II authors // // This file is subject to QPL and may not be distributed // without copyright and license information. Please refer @@ -69,6 +69,8 @@ class MGSmootherLAC : public MGSmootherBase int main() { + try + { ofstream logfile("mg.output"); deallog.attach(logfile); deallog.depth_console(0); @@ -123,7 +125,7 @@ int main() Vector u; u.reinit(f); PrimitiveVectorMemory<> mem; - SolverControl control(100, 1.e-12); + SolverControl control(1000, 1.e-10,false , true); SolverCG<> solver(control, mem); u = 0.; @@ -139,8 +141,8 @@ int main() mgA[i].reinit(mgstruct[i]); } equation.build_mgmatrix(mgA, mgdof, quadrature); - - SolverControl cgcontrol(10,0., false, false); + + SolverControl cgcontrol(1000,1.e-12, false, false); PrimitiveVectorMemory<> cgmem; SolverCG<> cgsolver(cgcontrol, cgmem); PreconditionIdentity cgprec; @@ -160,6 +162,13 @@ Multigrid<2> multigrid(mgdof, hanging_nodes, mgstruct, mgA, transfer); } deallog.pop(); } + + } + catch (const SolverControl::NoConvergence& e) + { + deallog << "Step " << e.last_step + << " Residual " << e.last_residual << endl; + } } template @@ -186,5 +195,11 @@ MGSmootherLAC::smooth (const unsigned int level, PreconditionSSOR<> prec; prec.initialize((*matrices)[level], 1.); - rich.solve((*matrices)[level], u, rhs, prec); + try + { + rich.solve((*matrices)[level], u, rhs, prec); + } + catch (const SolverControl::NoConvergence&) + { + } } diff --git a/tests/deal.II/mg.checked b/tests/deal.II/mg.checked index 7718f62359..60791912fc 100644 --- a/tests/deal.II/mg.checked +++ b/tests/deal.II/mg.checked @@ -2,36 +2,36 @@ DEAL:Q1::DoFs 9 DEAL:Q1::Levels: 2 DEAL:Q1:cg::Starting -DEAL:Q1:cg::Convergence step 4 +DEAL:Q1:cg::Convergence step 3 DEAL:Q1::DoFs 25 DEAL:Q1::Levels: 3 DEAL:Q1:cg::Starting -DEAL:Q1:cg::Convergence step 5 +DEAL:Q1:cg::Convergence step 4 DEAL:Q1::DoFs 81 DEAL:Q1::Levels: 4 DEAL:Q1:cg::Starting -DEAL:Q1:cg::Convergence step 6 +DEAL:Q1:cg::Convergence step 5 DEAL:Q2::DoFs 25 DEAL:Q2::Levels: 2 DEAL:Q2:cg::Starting -DEAL:Q2:cg::Convergence step 6 +DEAL:Q2:cg::Convergence step 5 DEAL:Q2::DoFs 81 DEAL:Q2::Levels: 3 DEAL:Q2:cg::Starting -DEAL:Q2:cg::Convergence step 7 +DEAL:Q2:cg::Convergence step 6 DEAL:Q2::DoFs 289 DEAL:Q2::Levels: 4 DEAL:Q2:cg::Starting -DEAL:Q2:cg::Convergence step 7 +DEAL:Q2:cg::Convergence step 6 DEAL:Q3::DoFs 49 DEAL:Q3::Levels: 2 DEAL:Q3:cg::Starting -DEAL:Q3:cg::Convergence step 8 +DEAL:Q3:cg::Convergence step 6 DEAL:Q3::DoFs 169 DEAL:Q3::Levels: 3 DEAL:Q3:cg::Starting -DEAL:Q3:cg::Convergence step 7 +DEAL:Q3:cg::Convergence step 6 DEAL:Q3::DoFs 625 DEAL:Q3::Levels: 4 DEAL:Q3:cg::Starting -DEAL:Q3:cg::Convergence step 7 +DEAL:Q3:cg::Convergence step 6