From: David Wells <drwells@email.unc.edu>
Date: Thu, 17 Jun 2021 14:40:50 +0000 (-0400)
Subject: Use check_solver_within_range in simplex/poisson_01.cc
X-Git-Tag: v9.4.0-rc1~1217^2~1
X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=492c0deaf644ff1130683f1810b6c92c73307750;p=dealii.git

Use check_solver_within_range in simplex/poisson_01.cc
---

diff --git a/tests/simplex/poisson_01.cc b/tests/simplex/poisson_01.cc
index 6c8be3920c..6392a7b4b6 100644
--- a/tests/simplex/poisson_01.cc
+++ b/tests/simplex/poisson_01.cc
@@ -252,12 +252,46 @@ test(const Triangulation<dim, spacedim> &tria,
 
   SolverControl        solver_control(1000, 1e-12);
   SolverCG<VectorType> solver(solver_control);
-  solver.solve(system_matrix, solution, system_rhs, PreconditionIdentity());
 
-  // deallog << solution.l2_norm() << " " << system_rhs.l2_norm() << std::endl;
+  const std::vector<ReferenceCell> reference_cells = tria.get_reference_cells();
+  Assert(reference_cells.size() == 1, ExcNotImplemented());
+  unsigned int lower = 0;
+  unsigned int upper = 0;
+  switch (reference_cells[0])
+    {
+      case ReferenceCells::Triangle:
+        lower = 111;
+        upper = 115;
+        break;
+      case ReferenceCells::Quadrilateral:
+        lower = 96;
+        upper = 100;
+        break;
+      case ReferenceCells::Tetrahedron:
+        lower = 154;
+        upper = 158;
+        break;
+      case ReferenceCells::Hexahedron:
+        lower = 132;
+        upper = 136;
+        break;
+      case ReferenceCells::Wedge:
+        lower = 194;
+        upper = 198;
+        break;
+      case ReferenceCells::Pyramid:
+        lower = 81;
+        upper = 85;
+        break;
+      default:
+        Assert(false, ExcInternalError());
+    }
 
-  deallog << "   with " << solver_control.last_step()
-          << " CG iterations needed to obtain convergence" << std::endl;
+  check_solver_within_range(
+    solver.solve(system_matrix, solution, system_rhs, PreconditionIdentity()),
+    solver_control.last_step(),
+    lower,
+    upper);
 
   // system_rhs.print(std::cout);
   // solution.print(std::cout);
diff --git a/tests/simplex/poisson_01.mpirun=1.with_trilinos=false.output b/tests/simplex/poisson_01.mpirun=1.with_trilinos=false.output
index 02c1cc8169..1b33ef1631 100644
--- a/tests/simplex/poisson_01.mpirun=1.with_trilinos=false.output
+++ b/tests/simplex/poisson_01.mpirun=1.with_trilinos=false.output
@@ -1,25 +1,25 @@
 
-DEAL:0::Solve problem on TRI mesh:
-DEAL:0::   on parallel::fullydistributed::Triangulation
-DEAL:0:cg::Starting value 0.245798
-DEAL:0:cg::Convergence step 114 value 6.62438e-13
-DEAL:0::   with 114 CG iterations needed to obtain convergence
-DEAL:0::
-DEAL:0::Solve problem on QUAD mesh:
-DEAL:0::   on parallel::distributed::Triangulation
-DEAL:0:cg::Starting value 0.244628
-DEAL:0:cg::Convergence step 98 value 8.55703e-13
-DEAL:0::   with 98 CG iterations needed to obtain convergence
-DEAL:0::
-DEAL:0::Solve problem on TET mesh:
-DEAL:0::   on parallel::fullydistributed::Triangulation
-DEAL:0:cg::Starting value 0.0607616
-DEAL:0:cg::Convergence step 156 value 9.07624e-13
-DEAL:0::   with 156 CG iterations needed to obtain convergence
-DEAL:0::
-DEAL:0::Solve problem on HEX mesh:
-DEAL:0::   on parallel::distributed::Triangulation
-DEAL:0:cg::Starting value 0.0573704
-DEAL:0:cg::Convergence step 134 value 8.23917e-13
-DEAL:0::   with 134 CG iterations needed to obtain convergence
-DEAL:0::
+DEAL::Solve problem on TRI mesh:
+DEAL::   on parallel::fullydistributed::Triangulation
+DEAL::Solver stopped within 111 - 115 iterations
+DEAL::
+DEAL::Solve problem on QUAD mesh:
+DEAL::   on parallel::distributed::Triangulation
+DEAL::Solver stopped within 96 - 100 iterations
+DEAL::
+DEAL::Solve problem on TET mesh:
+DEAL::   on parallel::fullydistributed::Triangulation
+DEAL::Solver stopped within 154 - 158 iterations
+DEAL::
+DEAL::Solve problem on HEX mesh:
+DEAL::   on parallel::distributed::Triangulation
+DEAL::Solver stopped within 132 - 136 iterations
+DEAL::
+DEAL::Solve problem on WEDGE mesh:
+DEAL::   on parallel::fullydistributed::Triangulation
+DEAL::Solver stopped within 194 - 198 iterations
+DEAL::
+DEAL::Solve problem on PYRAMID mesh:
+DEAL::   on parallel::fullydistributed::Triangulation
+DEAL::Solver stopped within 81 - 85 iterations
+DEAL::
diff --git a/tests/simplex/poisson_01.mpirun=1.with_trilinos=true.with_metis=true.output b/tests/simplex/poisson_01.mpirun=1.with_trilinos=true.with_metis=true.output
index afde6fa7c6..1b33ef1631 100644
--- a/tests/simplex/poisson_01.mpirun=1.with_trilinos=true.with_metis=true.output
+++ b/tests/simplex/poisson_01.mpirun=1.with_trilinos=true.with_metis=true.output
@@ -1,37 +1,25 @@
 
 DEAL::Solve problem on TRI mesh:
 DEAL::   on parallel::fullydistributed::Triangulation
-DEAL:cg::Starting value 0.245798
-DEAL:cg::Convergence step 114 value 6.62438e-13
-DEAL::   with 114 CG iterations needed to obtain convergence
+DEAL::Solver stopped within 111 - 115 iterations
 DEAL::
 DEAL::Solve problem on QUAD mesh:
 DEAL::   on parallel::distributed::Triangulation
-DEAL:cg::Starting value 0.244628
-DEAL:cg::Convergence step 98 value 8.55703e-13
-DEAL::   with 98 CG iterations needed to obtain convergence
+DEAL::Solver stopped within 96 - 100 iterations
 DEAL::
 DEAL::Solve problem on TET mesh:
 DEAL::   on parallel::fullydistributed::Triangulation
-DEAL:cg::Starting value 0.0607616
-DEAL:cg::Convergence step 156 value 9.07675e-13
-DEAL::   with 156 CG iterations needed to obtain convergence
+DEAL::Solver stopped within 154 - 158 iterations
 DEAL::
 DEAL::Solve problem on HEX mesh:
 DEAL::   on parallel::distributed::Triangulation
-DEAL:cg::Starting value 0.0573704
-DEAL:cg::Convergence step 134 value 8.23917e-13
-DEAL::   with 134 CG iterations needed to obtain convergence
+DEAL::Solver stopped within 132 - 136 iterations
 DEAL::
 DEAL::Solve problem on WEDGE mesh:
 DEAL::   on parallel::fullydistributed::Triangulation
-DEAL:cg::Starting value 0.0576447
-DEAL:cg::Convergence step 196 value 8.95502e-13
-DEAL::   with 196 CG iterations needed to obtain convergence
+DEAL::Solver stopped within 194 - 198 iterations
 DEAL::
 DEAL::Solve problem on PYRAMID mesh:
 DEAL::   on parallel::fullydistributed::Triangulation
-DEAL:cg::Starting value 0.101163
-DEAL:cg::Convergence step 83 value 8.81456e-13
-DEAL::   with 83 CG iterations needed to obtain convergence
+DEAL::Solver stopped within 81 - 85 iterations
 DEAL::
diff --git a/tests/simplex/poisson_01.mpirun=4.with_trilinos=true.with_metis=true.output b/tests/simplex/poisson_01.mpirun=4.with_trilinos=true.with_metis=true.output
index 18ba5d0158..1b33ef1631 100644
--- a/tests/simplex/poisson_01.mpirun=4.with_trilinos=true.with_metis=true.output
+++ b/tests/simplex/poisson_01.mpirun=4.with_trilinos=true.with_metis=true.output
@@ -1,37 +1,25 @@
 
 DEAL::Solve problem on TRI mesh:
 DEAL::   on parallel::fullydistributed::Triangulation
-DEAL:cg::Starting value 0.245798
-DEAL:cg::Convergence step 114 value 6.64515e-13
-DEAL::   with 114 CG iterations needed to obtain convergence
+DEAL::Solver stopped within 111 - 115 iterations
 DEAL::
 DEAL::Solve problem on QUAD mesh:
 DEAL::   on parallel::distributed::Triangulation
-DEAL:cg::Starting value 0.244628
-DEAL:cg::Convergence step 98 value 8.55703e-13
-DEAL::   with 98 CG iterations needed to obtain convergence
+DEAL::Solver stopped within 96 - 100 iterations
 DEAL::
 DEAL::Solve problem on TET mesh:
 DEAL::   on parallel::fullydistributed::Triangulation
-DEAL:cg::Starting value 0.0607616
-DEAL:cg::Convergence step 156 value 9.07649e-13
-DEAL::   with 156 CG iterations needed to obtain convergence
+DEAL::Solver stopped within 154 - 158 iterations
 DEAL::
 DEAL::Solve problem on HEX mesh:
 DEAL::   on parallel::distributed::Triangulation
-DEAL:cg::Starting value 0.0573704
-DEAL:cg::Convergence step 134 value 8.23917e-13
-DEAL::   with 134 CG iterations needed to obtain convergence
+DEAL::Solver stopped within 132 - 136 iterations
 DEAL::
 DEAL::Solve problem on WEDGE mesh:
 DEAL::   on parallel::fullydistributed::Triangulation
-DEAL:cg::Starting value 0.0576447
-DEAL:cg::Convergence step 196 value 8.89749e-13
-DEAL::   with 196 CG iterations needed to obtain convergence
+DEAL::Solver stopped within 194 - 198 iterations
 DEAL::
 DEAL::Solve problem on PYRAMID mesh:
 DEAL::   on parallel::fullydistributed::Triangulation
-DEAL:cg::Starting value 0.101163
-DEAL:cg::Convergence step 83 value 9.01991e-13
-DEAL::   with 83 CG iterations needed to obtain convergence
+DEAL::Solver stopped within 81 - 85 iterations
 DEAL::