]> https://gitweb.dealii.org/ - dealii.git/commitdiff
use rel. tolerance, and reduce basis to 85 and move doc block
authorNils Schween <nils.schween@mpi-hd.mpg.de>
Sat, 30 Sep 2023 18:55:51 +0000 (20:55 +0200)
committerNils Schween <nils.schween@mpi-hd.mpg.de>
Sat, 30 Sep 2023 18:55:51 +0000 (20:55 +0200)
examples/step-12/step-12.cc

index 7756bc5e24b65f329c692fc9874df4242f12ee82..891dc66cf6fb44e49dc0fd0385c764d65e3ad7d0 100644 (file)
@@ -468,19 +468,20 @@ namespace Step12
   // field. If the DoFs are renumbered in the downstream direction of the flow,
   // then a block Gauss-Seidel preconditioner (see the PreconditionBlockSOR
   // class with relaxation=1) does a much better job.
+
+  // We create an additional data object for the GMRES solver to increase the
+  // maximum number of basis vectors of the Krylov subspace. When this number
+  // is reached the GMRES algorithm is restarted using the solution of the
+  // previous iteration as the starting approximation. The choice of the
+  // number of basis vectors is a trade-off between memory consumption and
+  // convergence speed, since a longer basis means minimization over a larger
+  // space.
   template <int dim>
   void AdvectionProblem<dim>::solve()
   {
-    SolverControl solver_control(1000, 1e-12);
-    // We create an additional data object for the GMRES solver to increase the
-    // maximum number of basis vectors of the Krylov subspace. When this number
-    // is reached the GMRES algorithm is restarted using the solution of the
-    // previous iteration as the starting approximation. The choice of the
-    // number of basis vectors is a trade-off between memory consumption and
-    // convergence speed, since a longer basis means minimization over a larger
-    // space.
+    SolverControl solver_control(1000, 1e-6 * right_hand_side.l2_norm());
     SolverGMRES<Vector<double>>::AdditionalData additional_data;
-    additional_data.max_n_tmp_vectors = 100;
+    additional_data.max_n_tmp_vectors = 85;
     SolverGMRES<Vector<double>> solver(solver_control, additional_data);
 
     // Here we create the preconditioner,

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.