% slides for MG presentation
%
%\input {slide-macros-v4.tex}
\documentclass [pdf,frames]{prosper}
\usepackage {algorithmic,amsmath,amssymb}
\newcommand \bm [1] {{\bf #1}}
%\renewcommand{\bottomtext}{MG presentation, Jos van Kan,
%  DIAM, Delft, November 2003 (slide \thepage)}
\title {Multi Grid Presentation}
\author {Jos van Kan}
\email {j.vankan@math.tudelft.nl}
\institution {TU Delft}
\DefaultTransition {Dissolve}



\begin{document}
\maketitle
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\overlays{3}{
\begin {slide}{Two Grid Algorithm}
\begin{algorithmic}[1]
\fromSlide{1}
{\STATE Presets: $\bm u_h^0$, $\bm r_h^0 =\bm f_h - A \bm u_h^0$
\STATE $\bm u_h^{\text{prs}} = S(\bm u_h^0 , \bm b, A, n_0)$\COMMENT 
{Presmoothing}\STATE $\bm r_H = R_{Hh}\bm r_h$}
\fromSlide{2}{
\STATE Solve $A_H \bm  c_H = \bm r_H$
\STATE $\bm u_h^\text{cgc} = \bm u_h^p + P_{hH} \bm c_H$ \COMMENT{Coarse Grid 
Correction}}
\fromSlide{3}{ 
 \STATE  $\bm u_h^{\text{pos}} = S(\bm u_h^ \text{cgc}, \bm b, A, 
n_1)$\COMMENT {Postsmoothing}}
\end{algorithmic}
\end {slide}}
%\end {document}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\overlays{4}{
\begin {slide}{Multi Grid Algorithm}
\begin {algorithmic}
\fromSlide{1}{
\STATE {\textbf{MGRecursive 
$(A_\ell, \bm r_\ell, \bm c_\ell, \ell)$}}
\IF {$\ell<p-1$}
\STATE $\bm c_\ell = S(\bm 0 , \bm r_\ell, A_\ell, n_0)$\COMMENT {Presmoothing}}
\fromSlide{2}{
\STATE $\bm r_{\ell+1}=R_\ell (\bm r_\ell - A_\ell \bm c_\ell) $ 
\COMMENT {Calculate coarse grid residual}
\STATE $A_{\ell+1}=R_\ell A_{\ell} P_{\ell+1} $ \COMMENT{Calculate coarse grid 
matrix}} 
\fromSlide{3}{
\STATE call MGRecursive $(A_{\ell+1}, \bm r_{\ell+1}, \bm c_{\ell+1}, 
\ell+1) $
\STATE $\bm c_\ell = \bm c_\ell + P_{\ell+1} \bm c_{\ell+1}$ \COMMENT 
{Coarse grid correction}}
\fromSlide{4}{
\STATE $\bm c_{\ell}=S(\bm c_\ell, \bm r_\ell, A_\ell, n_1)$ 
\COMMENT{Postsmoothing} }
\ELSE 
\STATE Solve $A_{p-1} \bm c_{p-1}= \bm r_{p-1}$\COMMENT {Direct solution on 
coarsest level}
\ENDIF

\end {algorithmic}
\end{slide}
}
\end {document}
  
