]> https://gitweb.dealii.org/ - dealii-svn.git/commitdiff
exception handled
authorguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 25 Apr 2001 09:58:32 +0000 (09:58 +0000)
committerguido <guido@0785d39b-7218-0410-832d-ea1e28bc413d>
Wed, 25 Apr 2001 09:58:32 +0000 (09:58 +0000)
git-svn-id: https://svn.dealii.org/trunk@4485 0785d39b-7218-0410-832d-ea1e28bc413d

tests/deal.II/mg.cc
tests/deal.II/mg.checked

index 3d63864fbd56f0d298cffd3d2e1606434ba00a60..5b687d48dd8d0652f19acfd7d6a6508baf22ca75 100644 (file)
@@ -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<double> 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<int dim>
@@ -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&)
+    {
+    }
 }
index 7718f623593b7ba5160a5bed12a64de8f0ce5fc1..60791912fc0031724cd16f103b8b3b8743051eb9 100644 (file)
@@ -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 

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.