X-Git-Url: https://bilbo.iut-bm.univ-fcomte.fr/and/gitweb/book_gpu.git/blobdiff_plain/4932967a1c684dc3f7ed04c19144101278b79972..fd7d6f1c6c149f79839200277703c9ef950150f8:/BookGPU/Chapters/chapter16/bdf.tex diff --git a/BookGPU/Chapters/chapter16/bdf.tex b/BookGPU/Chapters/chapter16/bdf.tex index dcf6313..83abbc3 100644 --- a/BookGPU/Chapters/chapter16/bdf.tex +++ b/BookGPU/Chapters/chapter16/bdf.tex @@ -34,7 +34,7 @@ the index $i$ in $h_i$, $\alpha_1^i$ and $\alpha_2^i$ can be omitted. For the first step $t_1$, only the initial condition at $t_0$ is available. -Therefore backward-Euler is used, i.e., +Therefore backward Euler is used, i.e., \begin{equation}\label{eq:BE} \tfrac{1}{h_1}[q(x_1)-q(x_0)] + f(x_1) = b_1. \end{equation} @@ -116,6 +116,27 @@ J\! =\! \frac{\ud x_M}{\ud x_0} \! + \! \frac{\alpha_2}{h_M} C_{M-2} \frac{\ud x_{M-2}}{\ud x_0}\right]. \end{equation} +\begin{algorithm} +\caption{The matrix-free\index{matrix-free} method for + Krylov subspace\index{iterative method!Krylov subspace} construction.} +\label{alg:mf_Gear} + \KwIn{ current Krylov subspace basis vector $v$, + time step lengths $h_i$, + saved $C_i$ matrices and LU\index{LU} factors of $J_i$, $i=0,\ldots,M$} + \KwOut{ matrix-vector product $r$, such that $r = A v$} + solve $J_1 p_2 = h_1^{-1} C_0 v$ for $p_2$\; + solve $J_2 p_1 = h_2^{-1} \left( \alpha_1 C_1 p_2 + \alpha_2 C_0 v \right)$ for $p_1$\; + \For{$i=3 \ldots M$}{ + solve + $J_i p_0 = \alpha_1 h_i^{-1} C_{i-1} p_1 + \alpha_2 h_i^{-1} C_{i-2} p_2$ + for $p_0$ \label{line:mf_Gear_loop}\; + $p_2 = p_1$\; + $p_1 = p_0$\; + } + $r = (k-1) p_0 - k v$ \label{line:shift}\; +\end{algorithm} + + %% \begin{algorithm} %% \caption{The matrix-free\index{matrix-free} method for %% Krylov subspace\index{Krylov subspace} construction.} @@ -138,7 +159,6 @@ J\! =\! \frac{\ud x_M}{\ud x_0} %% \end{algorithmic} %% \end{algorithm} - %It is easy to judge that, as $J$ is dense, explicitly %computing $J$ is expensive and impractical for large problems. %In addition, with a dense matrix,