]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Use check_solver_within_range in simplex/poisson_01.cc
authorDavid Wells <drwells@email.unc.edu>
Thu, 17 Jun 2021 14:40:50 +0000 (10:40 -0400)
committerDavid Wells <drwells@email.unc.edu>
Thu, 17 Jun 2021 14:41:10 +0000 (10:41 -0400)
tests/simplex/poisson_01.cc
tests/simplex/poisson_01.mpirun=1.with_trilinos=false.output
tests/simplex/poisson_01.mpirun=1.with_trilinos=true.with_metis=true.output
tests/simplex/poisson_01.mpirun=4.with_trilinos=true.with_metis=true.output

index 6c8be3920c6a821d5bea2500377c3d529bbbe1ed..6392a7b4b6702b0981541b029cb7953d8a05edf1 100644 (file)
@@ -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);
index 02c1cc81696fdc56dccc64d3dae334aba30d4493..1b33ef1631dd39a50d580d1bea6a1619fd3b8dc4 100644 (file)
@@ -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::
index afde6fa7c6a308c2f7fc145b3642ecd33a585891..1b33ef1631dd39a50d580d1bea6a1619fd3b8dc4 100644 (file)
@@ -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::
index 18ba5d01584322d8b4380f0ac5ef8e08972654a9..1b33ef1631dd39a50d580d1bea6a1619fd3b8dc4 100644 (file)
@@ -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::

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.