diff --git a/docs/source/solving-interface.rst b/docs/source/solving-interface.rst index 4be395d60a..2fcadc5495 100644 --- a/docs/source/solving-interface.rst +++ b/docs/source/solving-interface.rst @@ -257,7 +257,6 @@ definite, and therefore can choose the conjugate gradient method, rather than GMRES. .. code-block:: python3 - solve(a == L, solver_parameters={'ksp_type': 'cg'}) To change the preconditioner used, we set the ``'pc_type'`` option. @@ -271,17 +270,23 @@ precondition the system with: solver_parameters={'pc_type': 'hypre', 'pc_hypre_type': 'boomeramg'}) -Although the `KSP` name suggests that only Krylov methods are -supported, this is not the case. We may, for example, solve the -system directly by computing an LU factorisation of the problem. To +Although the ``KSP`` name suggests that only Krylov methods are +supported, this is not the case. We may, for example, solve the +system directly by computing an LU factorisation of the problem. To do this, we set the ``pc_type`` to ``'lu'`` and tell PETSc to use a "preconditioner only" Krylov method: .. code-block:: python3 - solve(a == L, - solver_parameters={'ksp_type': 'preonly', - 'pc_type': 'lu'}) + solve(a == L, + solver_parameters={ + 'mat_type': 'aij', + 'ksp_type': 'preonly', + 'ksp_rtol': 1e-7, + 'pc_type': 'lu', + 'pc_factor_mat_solver_type' : 'mumps', + 'pc_factor_mat_mumps_icntl_14' : 200 + }) In a similar manner, we can use Jacobi preconditioned Richardson iterations with: @@ -290,7 +295,9 @@ iterations with: solve(a == L, solver_parameters={'ksp_type': 'richardson', - 'pc_type': 'jacobi'} + 'pc_type': 'jacobi', + 'pc_factor_mat_solver_type' : 'mumps', + 'pc_factor_mat_mumps_icntl_14' : 200}) .. note:: @@ -728,32 +735,41 @@ solving with. Default solver options ~~~~~~~~~~~~~~~~~~~~~~ -If no parameters are passed to a solve call, we use, in most cases, + +If no parameters are passed to a ``solve`` call, we use, in most cases, the defaults that PETSc supplies for solving the linear or nonlinear -system. We describe the most commonly modified options (along with -their defaults in Firedrake) here. For linear variational solves we +system. We describe the most commonly modified options (along with +their defaults in Firedrake) here. For linear variational solves we use: -* ``ksp_type``: GMRES, with a restart (``ksp_gmres_restart``) of 30 -* ``ksp_rtol``: 1e-7 -* ``ksp_atol``: 1e-50 -* ``ksp_divtol`` 1e4 -* ``ksp_max_it``: 10000 -* ``pc_type``: ILU (Jacobi preconditioning for mixed problems) +* ``mat_type``: ``aij`` +* ``ksp_type``: ``preonly`` +* ``ksp_rtol``: ``1e-7`` +* ``ksp_atol``: ``1e-50`` +* ``ksp_divtol``: ``1e4`` +* ``ksp_max_it``: ``10000`` +* ``pc_type``: ``lu`` +* ``pc_factor_mat_solver_type`` : ``mumps`` +* ``pc_factor_mat_mumps_icntl_14``: 200 + For nonlinear variational solves we have: -* ``snes_type``: Newton linesearch -* ``ksp_type``: GMRES, with a restart (``ksp_gmres_restart``) of 30 +* ``ksp_type``: ``preonly`` +* ``mat_type``: ``aij`` * ``snes_rtol``: 1e-8 * ``snes_atol``: 1e-50 * ``snes_stol``: 1e-8 * ``snes_max_it``: 50 +* ``snes_type`` : ``newtonls`` +* ``snes_linesearch_type`` : `basic` * ``ksp_rtol``: 1e-5 * ``ksp_atol``: 1e-50 * ``ksp_divtol``: 1e4 * ``ksp_max_it``: 10000 -* ``pc_type``: ILU (Jacobi preconditioning for mixed problems) +* ``pc_type``: ``lu`` +* ``pc_factor_mat_solver_type`` : ``mumps`` +* ``pc_factor_mat_mumps_icntl_14``: 200 To see the full view that PETSc has of solver objects, you can pass a view flag to the solve call. For linear solves pass: