## 6 Numerical Methods and Algorithms
### Models at the Macro-Scale
#### 6.1.2 Solution of the \"Discrete in Space\"
```
1:procedureFrontalDecomposition(\(\left\{A^{[l]}\right\}_{l=1,\ldots,l}\), \(L\))
2:Input \(\left\{A^{[l]}\right\}_{l=1,\ldots,l}\), \(L\)
3:Output \(L\), \(U\)
4:\(\boldsymbol{S}^{[l-1]}\leftarrow\boldsymbol{0}\)
5:for\(l=1\) to \(L\)do
6:\(\boldsymbol{F}^{[l]}\leftarrow\text{Compute }\boldsymbol{S}^{[l-1]}+A^{[l]}\)
7:\(L^{[l]}_{11},\boldsymbol{U}^{[l]}_{11}\leftarrow\text{Factorize }\boldsymbol{F}^{[l]}_{11}=L^{[l]}_{11}\boldsymbol{U}^{[l]}_{11}\)
8:\(\boldsymbol{U}^{[l]}_{12}\leftarrow\text{Solve }L^{[l]}_{11}\boldsymbol{U}^{[l]}_{12}=F^{[l]}_{12}\)
9:\(L^{[l]}_{21}\leftarrow\text{Solve }L^{[l]}_{21}\boldsymbol{U}^{[l]}_{11}=F^{[l]}_{21}\)
10:\(\boldsymbol{S}^{[l]}\leftarrow\text{Compute }\boldsymbol{S}^{[l]}=F^{[l]}_{22}-L^{[l]}_{21} \boldsymbol{U}^{[l]}_{12}\)
11:endfor
12:\(\boldsymbol{L}\leftarrow\text{Form }\boldsymbol{L}=\left[ \begin{array}{ c c c}L^{[1]}_{11}&\boldsymbol{0}&\ldots& \boldsymbol{0}\\ L^{[2]}_{11}&&\boldsymbol{0}\\ &&\ddots&\vdots\\ L^{[1]}_{21}&L^{[2]}_{21}&\ldots&L^{[1]}_{11}\\ \end{array} \right]\)
13:\(\boldsymbol{U}\leftarrow\text{Form }\boldsymbol{U}=\left[ \begin{array}{ c c c}\boldsymbol{U}^{[1]}_{11}&& \boldsymbol{U}^{[1]}_{2}\\ \boldsymbol{0}&\boldsymbol{U}^{[2]}_{11}&&\boldsymbol{U}^{[2]}_{12}\\ \vdots&&\ddots&\vdots\\ \boldsymbol{0}&\boldsymbol{0}&&\boldsymbol{U}^{[L]}_{11}\\ \end{array} \right]\)
14:endprocedure
```  
**Algorithm 4** The algorithm implementing the _\"Frontal method\"_. **Iterative methods:** Direct methods could exploit the sparse linear system structure as much as possible to avoid computations with zero elements and zero-element storage. However, these methods are often too expensive for large systems, except where the matrix \(A\) has a special structure. For many problems, the direct solution methods will not lead to solutions in a reasonable amount of time. So, researchers have long tried to iteratively approximate the solution \(\boldsymbol{x}\) starting from a \"good \" initial guess \(\boldsymbol{x}_{0}\) for the solution [151]. The Krylov subspace iteration methods (KSMs) are among the most important iterative techniques for solving linear systems because they have significantly altered how users approach huge, sparse, non-symmetric matrix problems. The techniques in question were recognized as one of the top ten algorithms that had the biggest impact on the advancement and application of science and engineering during the 1900s [110], and they seem to have also confirmed their importance in the current century due to the effort spent to improve their effectiveness and efficiency in up-to-date computing architecture. Like the majority of feasible iterative methods now in use for resolving large linear equation systems, KSM makes use of a projection process. A projection process is the standard method for taking an approximation from a subspace to the solution of a linear system [152]. Let \(\mathcal{K}_{N}\) and \(\mathcal{L}_{N}\) be two N-dimensional subspaces of \(\Re^{M}\). Finding an approximate solution \(\mathbf{x}_{N}\) to (125) requires a projection technique onto the subspace \(\mathcal{K}_{N}\) and orthogonal to \(\mathcal{L}_{N}\).