diff --git a/docs/src/gettingstarted.tex b/docs/src/gettingstarted.tex index 758d28f1..8d0d8c0a 100644 --- a/docs/src/gettingstarted.tex +++ b/docs/src/gettingstarted.tex @@ -219,7 +219,7 @@ Furthermore, specifying block-Jacobi as coarsest-level solver implies that the coarsest-level matrix is distributed among the processes. Figure~\ref{fig:ex3} shows how to set a W-cycle preconditioner which -applies no pre-smoother and 2 Gauss-Seidel sweeps as post-smoother, +applies 2 Gauss-Seidel sweeps as pre- and post-smoother, and solves the coarsest-level system with the multifrontal LU factorization implemented in MUMPS. It is specified that the coarsest-level matrix is distributed, since MUMPS can be used on both @@ -227,14 +227,14 @@ replicated and distributed matrices, and by default it is used on replicated ones. Note the use of the parameter \verb|pos| to specify a property only for the pre-smoother or the post-smoother (see Section~\ref{sec:precset} for more details). -Note also that a Krylov method different from CG must be used to solve -the preconditioned system, since the preconditione in nonsymmetric. The code fragments shown in Figures~\ref{fig:ex2} and \ref{fig:ex3} are included in the example program file \verb|mld_dexample_ml.f90| too. Finally, Figure~\ref{fig:ex4} shows the setup of a one-level -additive Schwarz preconditioner, i.e., RAS with overlap 2. The -corresponding example program is available in the file +additive Schwarz preconditioner, i.e., RAS with overlap 2. +Note also that a Krylov method different from CG must be used to solve +the preconditioned system, since the preconditione in nonsymmetric. +The corresponding example program is available in the file \verb|mld_dexample_1lev.f90|. For all the previous preconditioners, example programs where the sparse matrix and @@ -282,20 +282,18 @@ boundary conditions are also available in the directory \verb|examples/pdegen|. \begin{verbatim} ... ... ! build a W-cycle preconditioner with 2 Gauss-Seidel sweeps as -! post-smoother (and no pre-smoother), a distributed coarsest +! pre- and post-smoother, a distributed coarsest ! matrix, and MUMPS as coarsest-level solver call P%init('ML',info) call P%set('ML_TYPE','WCYCLE',info) call P%set('SMOOTHER_TYPE','GS',info) - call P%set('SMOOTHER_SWEEPS',0,info,pos='PRE') + call P%set('SMOOTHER_SWEEPS',2,info,pos='PRE') call P%set('SMOOTHER_SWEEPS',2,info,pos='POST') call P%set('COARSE_SOLVE','MUMPS',info) call P%set('COARSE_MAT','DIST',info) call P%hierarchy_build(A,desc_A,info) call P%smoothers_build(A,desc_A,info) ... ... -! solve Ax=b with preconditioned BiCGSTAB - call psb_krylov('BICGSTAB',A,P,b,x,tol,desc_A,info) \end{verbatim} } \end{minipage} @@ -314,6 +312,8 @@ boundary conditions are also available in the directory \verb|examples/pdegen|. call P%set('SUB_OVR',2,info) call P%bld(A,desc_A,info) ... ... +! solve Ax=b with preconditioned BiCGSTAB + call psb_krylov('BICGSTAB',A,P,b,x,tol,desc_A,info) \end{verbatim} } \end{minipage} diff --git a/examples/fileread/mld_dexample_ml.f90 b/examples/fileread/mld_dexample_ml.f90 index 44cec105..814f694c 100644 --- a/examples/fileread/mld_dexample_ml.f90 +++ b/examples/fileread/mld_dexample_ml.f90 @@ -53,7 +53,7 @@ ! sweeps (with ILU(0) on the blocks) as coarsest-level solver(Sec. 5.1, Fig. 3) ! ! - choice = 3, build a W-cycle preconditioner with 2 Gauss-Seidel sweeps as -! post-smoother (and no pre-smoother), a distributed coarsest +! pre- and post-smoother, a distributed coarsest ! matrix, and MUMPS as coarsest-level solver (Sec. 5.1, Fig. 4) ! ! The matrix and the rhs are read from files (if an rhs is not available, the @@ -238,11 +238,11 @@ program mld_dexample_ml call P%init('ML',info) call P%set('ML_TYPE','WCYCLE',info) call P%set('SMOOTHER_TYPE','GS',info) - call P%set('SMOOTHER_SWEEPS',0,info,pos='PRE') + call P%set('SMOOTHER_SWEEPS',2,info,pos='PRE') call P%set('SMOOTHER_SWEEPS',2,info,pos='POST') call P%set('COARSE_SOLVE','MUMPS',info) call P%set('COARSE_MAT','DIST',info) - kmethod = 'BICGSTAB' + kmethod = 'CG' end select ! build the preconditioner @@ -267,7 +267,7 @@ program mld_dexample_ml call x%zero() call psb_geasb(x,desc_A,info) - ! solve Ax=b with preconditioned BiCGSTAB + ! solve Ax=b with preconditioned CG call psb_barrier(ictxt) t1 = psb_wtime()