]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Make trilinos/precondition more robust 4826/head
authorDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Sun, 13 Aug 2017 23:35:49 +0000 (01:35 +0200)
committerDaniel Arndt <daniel.arndt@iwr.uni-heidelberg.de>
Sun, 13 Aug 2017 23:53:22 +0000 (01:53 +0200)
tests/trilinos/precondition.cc
tests/trilinos/precondition.output
tests/trilinos/precondition.output.2 [deleted file]
tests/trilinos/precondition.output.3 [deleted file]
tests/trilinos/precondition.output.4 [deleted file]

index fcfed69d4c9afa599417f0ae5b310c4703ca799c..29ff9f2a23964e96d6cc2a9cfdbece7d03087b11 100644 (file)
@@ -48,7 +48,7 @@ private:
   void make_grid ();
   void setup_system();
   void assemble_system ();
-  void solve ();
+  void solve (int cycle);
 
   Triangulation<dim>   triangulation;
   FE_Q<dim>            fe;
@@ -202,48 +202,52 @@ void Step4<dim>::assemble_system ()
 
 
 template <int dim>
-void Step4<dim>::solve ()
+void Step4<dim>::solve (int cycle)
 {
   deallog.push(Utilities::int_to_string(dof_handler.n_dofs(),5));
 
   {
     deallog.push("Jacobi");
+    static constexpr std::array<int,2> lower {49,100};
     TrilinosWrappers::PreconditionJacobi preconditioner;
     solution = 0;
     SolverControl           solver_control (1000, 1e-10);
     SolverCG<>              solver (solver_control);
     preconditioner.initialize(system_matrix);
-    solver.solve (system_matrix, solution, system_rhs,
-                  preconditioner);
+    check_solver_within_range(solver.solve(system_matrix,solution,system_rhs,preconditioner),
+                              solver_control.last_step(), lower[cycle], lower[cycle]+2);
     deallog.pop();
   }
 
   {
     deallog.push("SSOR");
+    static constexpr std::array<int,2> lower {40,77};
     TrilinosWrappers::PreconditionSSOR preconditioner;
     solution = 0;
     SolverControl           solver_control (1000, 1e-10);
     SolverCG<>              solver (solver_control);
     preconditioner.initialize(system_matrix);
-    solver.solve (system_matrix, solution, system_rhs,
-                  preconditioner);
+    check_solver_within_range(solver.solve(system_matrix,solution,system_rhs,preconditioner),
+                              solver_control.last_step(), lower[cycle], lower[cycle]+2);
     deallog.pop();
   }
 
   {
     deallog.push("SOR");
+    static constexpr std::array<int,2> lower {31,62};
     TrilinosWrappers::PreconditionSOR preconditioner;
     solution = 0;
     SolverControl           solver_control (1000, 1e-5);
     SolverBicgstab<>        solver (solver_control);
     preconditioner.initialize(system_matrix);
-    solver.solve (system_matrix, solution, system_rhs,
-                  preconditioner);
+    check_solver_within_range(solver.solve(system_matrix,solution,system_rhs,preconditioner),
+                              solver_control.last_step(), lower[cycle], lower[cycle]+2);
     deallog.pop();
   }
 
   {
     deallog.push("BlockJacobi");
+    static constexpr std::array<int,2> lower {73,145};
     TrilinosWrappers::PreconditionBlockJacobi preconditioner;
     TrilinosWrappers::PreconditionBlockJacobi::AdditionalData data;
     data.block_size = 16;
@@ -251,13 +255,14 @@ void Step4<dim>::solve ()
     SolverControl           solver_control (1000, 1e-10);
     SolverCG<>              solver (solver_control);
     preconditioner.initialize(system_matrix, data);
-    solver.solve (system_matrix, solution, system_rhs,
-                  preconditioner);
+    check_solver_within_range(solver.solve(system_matrix,solution,system_rhs,preconditioner),
+                              solver_control.last_step(), lower[cycle], lower[cycle]+2);
     deallog.pop();
   }
 
   {
     deallog.push("BlockSSOR");
+    static constexpr std::array<int,2> lower {30,59};
     TrilinosWrappers::PreconditionBlockSSOR preconditioner;
     TrilinosWrappers::PreconditionBlockSSOR::AdditionalData data;
     data.block_size = 16;
@@ -266,13 +271,14 @@ void Step4<dim>::solve ()
     SolverControl           solver_control (1000, 1e-10);
     SolverCG<>              solver (solver_control);
     preconditioner.initialize(system_matrix, data);
-    solver.solve (system_matrix, solution, system_rhs,
-                  preconditioner);
+    check_solver_within_range(solver.solve(system_matrix,solution,system_rhs,preconditioner),
+                              solver_control.last_step(), lower[cycle], lower[cycle]+2);
     deallog.pop();
   }
 
   {
     deallog.push("BlockSOR");
+    static constexpr std::array<int,2> lower {18,37};
     TrilinosWrappers::PreconditionBlockSOR preconditioner;
     TrilinosWrappers::PreconditionBlockSOR::AdditionalData data;
     data.block_size = 16;
@@ -281,37 +287,40 @@ void Step4<dim>::solve ()
     SolverControl           solver_control (1000, 1e-5);
     SolverBicgstab<>        solver (solver_control);
     preconditioner.initialize(system_matrix, data);
-    solver.solve (system_matrix, solution, system_rhs,
-                  preconditioner);
+    check_solver_within_range(solver.solve(system_matrix,solution,system_rhs,preconditioner),
+                              solver_control.last_step(), lower[cycle], lower[cycle]+2);
     deallog.pop();
   }
 
   {
     deallog.push("IC");
+    static constexpr std::array<int,2> lower {51,69};
     TrilinosWrappers::PreconditionIC preconditioner;
     solution = 0;
     SolverControl           solver_control (1000, 1e-10);
     SolverCG<>              solver (solver_control);
     preconditioner.initialize(system_matrix);
-    solver.solve (system_matrix, solution, system_rhs,
-                  preconditioner);
+    check_solver_within_range(solver.solve(system_matrix,solution,system_rhs,preconditioner),
+                              solver_control.last_step(), lower[cycle], lower[cycle]+2);
     deallog.pop();
   }
 
   {
+    static constexpr std::array<int,2> lower {30,56};
     deallog.push("ILU");
     TrilinosWrappers::PreconditionILU preconditioner;
     solution = 0;
     SolverControl           solver_control (1000, 1e-10);
     SolverCG<>              solver (solver_control);
     preconditioner.initialize(system_matrix);
-    solver.solve (system_matrix, solution, system_rhs,
-                  preconditioner);
+    check_solver_within_range(solver.solve(system_matrix,solution,system_rhs,preconditioner),
+                              solver_control.last_step(), lower[cycle], lower[cycle]+2);
     deallog.pop();
   }
 
   {
     deallog.push("ILUT");
+    static constexpr std::array<int,2> lower {11,19};
     TrilinosWrappers::PreconditionILUT preconditioner;
     TrilinosWrappers::PreconditionILUT::AdditionalData data;
     data.ilut_drop = 1e-6;
@@ -320,13 +329,14 @@ void Step4<dim>::solve ()
     SolverControl           solver_control (1000, 1e-5);
     SolverBicgstab<>        solver (solver_control);
     preconditioner.initialize(system_matrix, data);
-    solver.solve (system_matrix, solution, system_rhs,
-                  preconditioner);
+    check_solver_within_range(solver.solve(system_matrix,solution,system_rhs,preconditioner),
+                              solver_control.last_step(), lower[cycle], lower[cycle]+2);
     deallog.pop();
   }
 
   {
     deallog.push("Chebyshev");
+    static constexpr std::array<int,2> lower {23,46};
     TrilinosWrappers::PreconditionChebyshev preconditioner;
     TrilinosWrappers::PreconditionChebyshev::AdditionalData data;
     data.max_eigenvalue = 2.5;
@@ -335,8 +345,8 @@ void Step4<dim>::solve ()
     SolverControl           solver_control (1000, 1e-10);
     SolverCG<>              solver (solver_control);
     preconditioner.initialize(system_matrix, data);
-    solver.solve (system_matrix, solution, system_rhs,
-                  preconditioner);
+    check_solver_within_range(solver.solve(system_matrix,solution,system_rhs,preconditioner),
+                              solver_control.last_step(), lower[cycle], lower[cycle]+2);
     deallog.pop();
   }
 
@@ -347,8 +357,8 @@ void Step4<dim>::solve ()
     SolverControl           solver_control (1000, 1e-10);
     SolverCG<>              solver (solver_control);
     preconditioner.initialize(system_matrix);
-    solver.solve (system_matrix, solution, system_rhs,
-                  preconditioner);
+    check_solver_within_range(solver.solve(system_matrix,solution,system_rhs,preconditioner),
+                              solver_control.last_step(), 1, 1);
     deallog.pop();
   }
 
@@ -370,7 +380,7 @@ void Step4<dim>::run()
 
       setup_system();
       assemble_system();
-      solve();
+      solve(cycle);
     }
 }
 
index 28c7e71134fe123fbe88f371fa0973ed9f6aab7c..0e7329815e9065e0656d74a196712f6177a4429e 100644 (file)
@@ -1,45 +1,23 @@
 
-DEAL:01089:Jacobi:cg::Starting value 15.4650
-DEAL:01089:Jacobi:cg::Convergence step 50 value 4.48478e-11
-DEAL:01089:SSOR:cg::Starting value 15.4650
-DEAL:01089:SSOR:cg::Convergence step 41 value 4.42998e-11
-DEAL:01089:SOR:Bicgstab::Starting value 15.4650
-DEAL:01089:SOR:Bicgstab::Convergence step 32 value 3.30388e-06
-DEAL:01089:BlockJacobi:cg::Starting value 15.4650
-DEAL:01089:BlockJacobi:cg::Convergence step 74 value 6.73830e-11
-DEAL:01089:BlockSSOR:cg::Starting value 15.4650
-DEAL:01089:BlockSSOR:cg::Convergence step 31 value 7.86992e-11
-DEAL:01089:BlockSOR:Bicgstab::Starting value 15.4650
-DEAL:01089:BlockSOR:Bicgstab::Convergence step 19 value 7.10623e-06
-DEAL:01089:IC:cg::Starting value 15.4650
-DEAL:01089:IC:cg::Convergence step 52 value 8.58018e-11
-DEAL:01089:ILU:cg::Starting value 15.4650
-DEAL:01089:ILU:cg::Convergence step 31 value 4.81299e-11
-DEAL:01089:ILUT:Bicgstab::Starting value 15.4650
-DEAL:01089:ILUT:Bicgstab::Convergence step 12 value 1.37052e-06
-DEAL:01089:Chebyshev:cg::Starting value 15.4650
-DEAL:01089:Chebyshev:cg::Convergence step 24 value 9.92823e-11
-DEAL:01089:Direct:cg::Starting value 15.4650
-DEAL:01089:Direct:cg::Convergence step 1 value 4.94722e-14
-DEAL:04225:Jacobi:cg::Starting value 21.8299
-DEAL:04225:Jacobi:cg::Convergence step 101 value 5.77109e-11
-DEAL:04225:SSOR:cg::Starting value 21.8299
-DEAL:04225:SSOR:cg::Convergence step 78 value 4.50033e-11
-DEAL:04225:SOR:Bicgstab::Starting value 21.8299
-DEAL:04225:SOR:Bicgstab::Convergence step 63 value 7.96877e-06
-DEAL:04225:BlockJacobi:cg::Starting value 21.8299
-DEAL:04225:BlockJacobi:cg::Convergence step 146 value 9.98613e-11
-DEAL:04225:BlockSSOR:cg::Starting value 21.8299
-DEAL:04225:BlockSSOR:cg::Convergence step 60 value 6.80642e-11
-DEAL:04225:BlockSOR:Bicgstab::Starting value 21.8299
-DEAL:04225:BlockSOR:Bicgstab::Convergence step 38 value 9.92349e-06
-DEAL:04225:IC:cg::Starting value 21.8299
-DEAL:04225:IC:cg::Convergence step 69 value 9.23798e-11
-DEAL:04225:ILU:cg::Starting value 21.8299
-DEAL:04225:ILU:cg::Convergence step 57 value 8.22307e-11
-DEAL:04225:ILUT:Bicgstab::Starting value 21.8299
-DEAL:04225:ILUT:Bicgstab::Convergence step 20 value 3.49065e-06
-DEAL:04225:Chebyshev:cg::Starting value 21.8299
-DEAL:04225:Chebyshev:cg::Convergence step 47 value 7.80130e-11
-DEAL:04225:Direct:cg::Starting value 21.8299
-DEAL:04225:Direct:cg::Convergence step 1 value 1.51477e-13
+DEAL:01089:Jacobi::Solver stopped within 49 - 51 iterations
+DEAL:01089:SSOR::Solver stopped within 40 - 42 iterations
+DEAL:01089:SOR::Solver stopped within 31 - 33 iterations
+DEAL:01089:BlockJacobi::Solver stopped within 73 - 75 iterations
+DEAL:01089:BlockSSOR::Solver stopped within 30 - 32 iterations
+DEAL:01089:BlockSOR::Solver stopped within 18 - 20 iterations
+DEAL:01089:IC::Solver stopped within 51 - 53 iterations
+DEAL:01089:ILU::Solver stopped within 30 - 32 iterations
+DEAL:01089:ILUT::Solver stopped within 11 - 13 iterations
+DEAL:01089:Chebyshev::Solver stopped within 23 - 25 iterations
+DEAL:01089:Direct::Solver stopped within 1 - 1 iterations
+DEAL:04225:Jacobi::Solver stopped within 100 - 102 iterations
+DEAL:04225:SSOR::Solver stopped within 77 - 79 iterations
+DEAL:04225:SOR::Solver stopped within 62 - 64 iterations
+DEAL:04225:BlockJacobi::Solver stopped within 145 - 147 iterations
+DEAL:04225:BlockSSOR::Solver stopped within 59 - 61 iterations
+DEAL:04225:BlockSOR::Solver stopped within 37 - 39 iterations
+DEAL:04225:IC::Solver stopped within 69 - 71 iterations
+DEAL:04225:ILU::Solver stopped within 56 - 58 iterations
+DEAL:04225:ILUT::Solver stopped within 19 - 21 iterations
+DEAL:04225:Chebyshev::Solver stopped within 46 - 48 iterations
+DEAL:04225:Direct::Solver stopped within 1 - 1 iterations
diff --git a/tests/trilinos/precondition.output.2 b/tests/trilinos/precondition.output.2
deleted file mode 100644 (file)
index 5cb1357..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-
-DEAL:01089:Jacobi:cg::Starting value 15.4650
-DEAL:01089:Jacobi:cg::Convergence step 50 value 0
-DEAL:01089:SSOR:cg::Starting value 15.4650
-DEAL:01089:SSOR:cg::Convergence step 41 value 0
-DEAL:01089:SOR:Bicgstab::Starting value 15.4650
-DEAL:01089:SOR:Bicgstab::Convergence step 32 value 0
-DEAL:01089:BlockJacobi:cg::Starting value 15.4650
-DEAL:01089:BlockJacobi:cg::Convergence step 74 value 0
-DEAL:01089:BlockSSOR:cg::Starting value 15.4650
-DEAL:01089:BlockSSOR:cg::Convergence step 31 value 0
-DEAL:01089:BlockSOR:Bicgstab::Starting value 15.4650
-DEAL:01089:BlockSOR:Bicgstab::Convergence step 19 value 0
-DEAL:01089:IC:cg::Starting value 15.4650
-DEAL:01089:IC:cg::Convergence step 53 value 0
-DEAL:01089:ILU:cg::Starting value 15.4650
-DEAL:01089:ILU:cg::Convergence step 31 value 0
-DEAL:01089:ILUT:Bicgstab::Starting value 15.4650
-DEAL:01089:ILUT:Bicgstab::Convergence step 12 value 0
-DEAL:01089:Chebyshev:cg::Starting value 15.4650
-DEAL:01089:Chebyshev:cg::Convergence step 24 value 0
-DEAL:01089:Direct:cg::Starting value 15.4650
-DEAL:01089:Direct:cg::Convergence step 1 value 0
-DEAL:04225:Jacobi:cg::Starting value 21.8299
-DEAL:04225:Jacobi:cg::Convergence step 101 value 0
-DEAL:04225:SSOR:cg::Starting value 21.8299
-DEAL:04225:SSOR:cg::Convergence step 78 value 0
-DEAL:04225:SOR:Bicgstab::Starting value 21.8299
-DEAL:04225:SOR:Bicgstab::Convergence step 63 value 0
-DEAL:04225:BlockJacobi:cg::Starting value 21.8299
-DEAL:04225:BlockJacobi:cg::Convergence step 146 value 0
-DEAL:04225:BlockSSOR:cg::Starting value 21.8299
-DEAL:04225:BlockSSOR:cg::Convergence step 60 value 0
-DEAL:04225:BlockSOR:Bicgstab::Starting value 21.8299
-DEAL:04225:BlockSOR:Bicgstab::Convergence step 38 value 0
-DEAL:04225:IC:cg::Starting value 21.8299
-DEAL:04225:IC:cg::Convergence step 70 value 0
-DEAL:04225:ILU:cg::Starting value 21.8299
-DEAL:04225:ILU:cg::Convergence step 57 value 0
-DEAL:04225:ILUT:Bicgstab::Starting value 21.8299
-DEAL:04225:ILUT:Bicgstab::Convergence step 20 value 0
-DEAL:04225:Chebyshev:cg::Starting value 21.8299
-DEAL:04225:Chebyshev:cg::Convergence step 47 value 0
-DEAL:04225:Direct:cg::Starting value 21.8299
-DEAL:04225:Direct:cg::Convergence step 1 value 0
diff --git a/tests/trilinos/precondition.output.3 b/tests/trilinos/precondition.output.3
deleted file mode 100644 (file)
index 9415d6d..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-
-DEAL:01089:Jacobi:cg::Starting value 15.4650
-DEAL:01089:Jacobi:cg::Convergence step 50 value 0
-DEAL:01089:SSOR:cg::Starting value 15.4650
-DEAL:01089:SSOR:cg::Convergence step 41 value 0
-DEAL:01089:SOR:Bicgstab::Starting value 15.4650
-DEAL:01089:SOR:Bicgstab::Convergence step 32 value 0
-DEAL:01089:BlockJacobi:cg::Starting value 15.4650
-DEAL:01089:BlockJacobi:cg::Convergence step 74 value 0
-DEAL:01089:BlockSSOR:cg::Starting value 15.4650
-DEAL:01089:BlockSSOR:cg::Convergence step 31 value 0
-DEAL:01089:BlockSOR:Bicgstab::Starting value 15.4650
-DEAL:01089:BlockSOR:Bicgstab::Convergence step 19 value 0
-DEAL:01089:IC:cg::Starting value 15.4650
-DEAL:01089:IC:cg::Convergence step 53 value 0
-DEAL:01089:ILU:cg::Starting value 15.4650
-DEAL:01089:ILU:cg::Convergence step 31 value 0
-DEAL:01089:ILUT:Bicgstab::Starting value 15.4650
-DEAL:01089:ILUT:Bicgstab::Convergence step 12 value 0
-DEAL:01089:Chebyshev:cg::Starting value 15.4650
-DEAL:01089:Chebyshev:cg::Convergence step 24 value 0
-DEAL:01089:Direct:cg::Starting value 15.4650
-DEAL:01089:Direct:cg::Convergence step 1 value 0
-DEAL:04225:Jacobi:cg::Starting value 21.8299
-DEAL:04225:Jacobi:cg::Convergence step 101 value 0
-DEAL:04225:SSOR:cg::Starting value 21.8299
-DEAL:04225:SSOR:cg::Convergence step 78 value 0
-DEAL:04225:SOR:Bicgstab::Starting value 21.8299
-DEAL:04225:SOR:Bicgstab::Convergence step 63 value 0
-DEAL:04225:BlockJacobi:cg::Starting value 21.8299
-DEAL:04225:BlockJacobi:cg::Convergence step 146 value 0
-DEAL:04225:BlockSSOR:cg::Starting value 21.8299
-DEAL:04225:BlockSSOR:cg::Convergence step 60 value 0
-DEAL:04225:BlockSOR:Bicgstab::Starting value 21.8299
-DEAL:04225:BlockSOR:Bicgstab::Convergence step 38 value 0
-DEAL:04225:IC:cg::Starting value 21.8299
-DEAL:04225:IC:cg::Convergence step 69 value 0
-DEAL:04225:ILU:cg::Starting value 21.8299
-DEAL:04225:ILU:cg::Convergence step 57 value 0
-DEAL:04225:ILUT:Bicgstab::Starting value 21.8299
-DEAL:04225:ILUT:Bicgstab::Convergence step 20 value 0
-DEAL:04225:Chebyshev:cg::Starting value 21.8299
-DEAL:04225:Chebyshev:cg::Convergence step 47 value 0
-DEAL:04225:Direct:cg::Starting value 21.8299
-DEAL:04225:Direct:cg::Convergence step 1 value 0
diff --git a/tests/trilinos/precondition.output.4 b/tests/trilinos/precondition.output.4
deleted file mode 100644 (file)
index 61a4711..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-
-DEAL:01089:Jacobi:cg::Starting value 15.4650
-DEAL:01089:Jacobi:cg::Convergence step 50 value 0
-DEAL:01089:SSOR:cg::Starting value 15.4650
-DEAL:01089:SSOR:cg::Convergence step 41 value 0
-DEAL:01089:SOR:Bicgstab::Starting value 15.4650
-DEAL:01089:SOR:Bicgstab::Convergence step 32 value 0
-DEAL:01089:BlockJacobi:cg::Starting value 15.4650
-DEAL:01089:BlockJacobi:cg::Convergence step 74 value 0
-DEAL:01089:BlockSSOR:cg::Starting value 15.4650
-DEAL:01089:BlockSSOR:cg::Convergence step 31 value 0
-DEAL:01089:BlockSOR:Bicgstab::Starting value 15.4650
-DEAL:01089:BlockSOR:Bicgstab::Convergence step 19 value 0
-DEAL:01089:IC:cg::Starting value 15.4650
-DEAL:01089:IC:cg::Convergence step 52 value 0
-DEAL:01089:ILU:cg::Starting value 15.4650
-DEAL:01089:ILU:cg::Convergence step 31 value 0
-DEAL:01089:ILUT:Bicgstab::Starting value 15.4650
-DEAL:01089:ILUT:Bicgstab::Convergence step 12 value 0
-DEAL:01089:Chebyshev:cg::Starting value 15.4650
-DEAL:01089:Chebyshev:cg::Convergence step 24 value 0
-DEAL:01089:Direct:cg::Starting value 15.4650
-DEAL:01089:Direct:cg::Convergence step 1 value 0
-DEAL:04225:Jacobi:cg::Starting value 21.8299
-DEAL:04225:Jacobi:cg::Convergence step 101 value 0
-DEAL:04225:SSOR:cg::Starting value 21.8299
-DEAL:04225:SSOR:cg::Convergence step 78 value 0
-DEAL:04225:SOR:Bicgstab::Starting value 21.8299
-DEAL:04225:SOR:Bicgstab::Convergence step 63 value 0
-DEAL:04225:BlockJacobi:cg::Starting value 21.8299
-DEAL:04225:BlockJacobi:cg::Convergence step 146 value 0
-DEAL:04225:BlockSSOR:cg::Starting value 21.8299
-DEAL:04225:BlockSSOR:cg::Convergence step 60 value 0
-DEAL:04225:BlockSOR:Bicgstab::Starting value 21.8299
-DEAL:04225:BlockSOR:Bicgstab::Convergence step 38 value 0
-DEAL:04225:IC:cg::Starting value 21.8299
-DEAL:04225:IC:cg::Convergence step 69 value 0
-DEAL:04225:ILU:cg::Starting value 21.8299
-DEAL:04225:ILU:cg::Convergence step 57 value 0
-DEAL:04225:ILUT:Bicgstab::Starting value 21.8299
-DEAL:04225:ILUT:Bicgstab::Convergence step 20 value 0
-DEAL:04225:Chebyshev:cg::Starting value 21.8299
-DEAL:04225:Chebyshev:cg::Convergence step 47 value 0
-DEAL:04225:Direct:cg::Starting value 21.8299
-DEAL:04225:Direct:cg::Convergence step 1 value 0

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.