]> https://gitweb.dealii.org/ - dealii.git/commitdiff
port other tests to new macro 361/head
authorMatthias Maier <tamiko@kyomu.43-1.org>
Fri, 19 Dec 2014 11:45:22 +0000 (12:45 +0100)
committerMatthias Maier <tamiko@kyomu.43-1.org>
Fri, 19 Dec 2014 11:55:36 +0000 (12:55 +0100)
tests/hp/step-3c.cc
tests/petsc/deal_solver_02.cc
tests/trilinos/deal_solver_02.cc

index 947e32cefc518bf17644407fb8258b0dc53c7306..34511de72b22835edd7531bfde715eabc29c377f 100644 (file)
@@ -225,22 +225,9 @@ void LaplaceProblem::solve ()
   SolverControl           solver_control (1000, 1e-6);
   SolverCG<>              cg (solver_control);
 
-  deallog.depth_file(0);
-  cg.solve (system_matrix, solution, system_rhs,
-            PreconditionIdentity());
-  deallog.depth_file(3);
-
-  const unsigned int steps = solver_control.last_step();
-  if (steps >= 629 && steps <= 630)
-    {
-      deallog << "Solver stopped within 629 - 630 iterations"
-              << std::endl;
-    }
-  else
-    {
-      deallog << "Solver stopped after " << steps << " iterations"
-              << std::endl;
-    }
+  check_solver_within_range(
+      cg.solve(system_matrix, solution, system_rhs, PreconditionIdentity()),
+      solver_control.last_step(), 629, 630);
 
   solution.print (deallog.get_file_stream());
 
index b45cb28dff7da959c4edf343c2950e995a158e45..0ef008f3e702ce3524a90c14ee1d1fc442bed4f8 100644 (file)
@@ -51,28 +51,15 @@ check_solve( SOLVER &solver,
   f = 1.;
   try
     {
-      deallog.depth_file(0);
-      solver.solve(A,u,f,P);
-      deallog.depth_file(3);
+      check_solver_within_range(
+        solver.solve(A,u,f,P),
+        solver_control.last_step(), 49, 51);
     }
   catch (std::exception &e)
     {
-      deallog.depth_file(3);
       deallog << e.what() << std::endl;
       abort ();
     }
-
-  const unsigned int steps = solver_control.last_step();
-  if (steps >= 49 && steps <= 51)
-    {
-      deallog << "Solver stopped within 49 - 51 iterations"
-              << std::endl;
-    }
-  else
-    {
-      deallog << "Solver stopped after " << solver_control.last_step()
-              << " iterations" << std::endl;
-    }
 }
 
 
index 6457179c2ede7bd9f0910bbc1622eb29107c6d8e..c42605c75b36b505bd9844628b91d70dd056e160 100644 (file)
@@ -52,28 +52,15 @@ check_solve( SOLVER &solver,
   f = 1.;
   try
     {
-      deallog.depth_file(0);
-      solver.solve(A,u,f,P);
-      deallog.depth_file(3);
+      check_solver_within_range(
+        solver.solve(A,u,f,P),
+        solver_control.last_step(), 49, 51);
     }
   catch (std::exception &e)
     {
-      deallog.depth_file(3);
       deallog << e.what() << std::endl;
       abort ();
     }
-
-  const unsigned int steps = solver_control.last_step();
-  if (steps >= 49 && steps <= 51)
-    {
-      deallog << "Solver stopped within 49 - 51 iterations"
-              << std::endl;
-    }
-  else
-    {
-      deallog << "Solver stopped after " << solver_control.last_step()
-              << " iterations" << std::endl;
-    }
 }
 
 

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.