diff --git a/doc/source/parameters/cfd/linear_solver_control.rst b/doc/source/parameters/cfd/linear_solver_control.rst index 16b915cdba..5d72c1dbe1 100644 --- a/doc/source/parameters/cfd/linear_solver_control.rst +++ b/doc/source/parameters/cfd/linear_solver_control.rst @@ -264,7 +264,7 @@ Different parameters for the main components of the two geometric multigrid algo Evaluating terms involving the hessian is expensive. Therefore, one can turn on or off those terms in the mg level operators to improve performance by setting ``mg enable hessians in jacobian`` to ``false``. This is useful for certain problems and must be used carefully. .. tip:: - The ``mg int level`` option only works for ``gcmg`` preconditioner. It allows to choose an intermediate level as coarse grid solver and to perform several multigrid v-cycles there. + The ``mg int level`` option only works for the ``gcmg`` preconditioner. It allows to choose an intermediate level as coarse grid solver where a GMRES preconditioned by several multigrid v-cycles is used. The following parameters: ``set mg gmres max iterations``, ``set mg gmres tolerance`` and ``set mg gmres reduce`` can be used to set the desired number of maximum iterations, the absolute tolerance and the relative tolerance. In addition, Lethe supports `p-multigrid` through the ``gcmg`` preconditioner. It can be used by specifying two additional parameters: diff --git a/source/solvers/fluid_dynamics_matrix_free.cc b/source/solvers/fluid_dynamics_matrix_free.cc index 29e0cefc25..e1fe2036cb 100644 --- a/source/solvers/fluid_dynamics_matrix_free.cc +++ b/source/solvers/fluid_dynamics_matrix_free.cc @@ -1647,9 +1647,19 @@ MFNavierStokesPreconditionGMG::initialize( std::make_shared>( this->dof_handler, *this->mg_intermediate, *this->mg_transfer_gc); - // TODO: introduce parameters + const int max_iterations = this->simulation_parameters.linear_solver + .at(PhysicsID::fluid_dynamics) + .mg_gmres_max_iterations; + const double tolerance = this->simulation_parameters.linear_solver + .at(PhysicsID::fluid_dynamics) + .mg_gmres_tolerance; + const double reduce = this->simulation_parameters.linear_solver + .at(PhysicsID::fluid_dynamics) + .mg_gmres_reduce; + this->coarse_grid_solver_control_intermediate = - std::make_shared(1000, 1e-20, 1e-2, false, false); + std::make_shared( + max_iterations, tolerance, reduce, false, false); this->coarse_grid_solver_intermediate = std::make_shared>(