From 669c68087e9d4a5c2ae1ef1ac91902e663ecf955 Mon Sep 17 00:00:00 2001 From: Nils Schween Date: Sat, 30 Sep 2023 20:55:51 +0200 Subject: [PATCH] use rel. tolerance, and reduce basis to 85 and move doc block --- examples/step-12/step-12.cc | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/examples/step-12/step-12.cc b/examples/step-12/step-12.cc index 7756bc5e24..891dc66cf6 100644 --- a/examples/step-12/step-12.cc +++ b/examples/step-12/step-12.cc @@ -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 void AdvectionProblem::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>::AdditionalData additional_data; - additional_data.max_n_tmp_vectors = 100; + additional_data.max_n_tmp_vectors = 85; SolverGMRES> solver(solver_control, additional_data); // Here we create the preconditioner, -- 2.39.5