# Vectorized Numerical Algorithms to Solve Internal Problems of Computational Fluid Dynamics
## 8 Transition Formulas  
The vector of physical variables is expressed in terms of vectors of computational variables. Consider the agreement that the computational vector is formed taking into account the form of specifying the right boundary conditions  
\[\mathbf{U}_{i}=T_{L}^{i}\mathbf{W}_{i}+T_{R}^{i}\mathbf{W}_{i+1}, \tag{11}\]  
where \(i=2,\ldots,N-1\). Relation (11) formalizes a simple shift in components, which is conducted in such a way that the components of computational vectors fall into place in the physical vectors.  
The right permutation matrix \(T_{R}\) contains the components of index vector \(\mathbf{I}_{R}\) on the main diagonal, and the remaining components of this matrix are zero  
\[T_{R}^{i}=\mathbf{I}_{R}E=\left(\begin{array}{cccc}I_{R}^{1}&0&\cdots&0\\ 0&I_{R}^{2}&\cdots&0\\ \vdots&\vdots&\ddots&\vdots\\ 0&0&\cdots&I_{R}^{M}\end{array}\right).\]  
The left permutation matrix \(T_{L}\) contains zeros on the main diagonal where the corresponding components of index vector \(\mathbf{I}_{R}\) are equal to one, and ones otherwise, and the remaining components of this matrix are equal to zero  
\[T_{L}^{i}=E-T_{R}^{i}=\left(\begin{array}{cccc}1-I_{R}^{1}&0&\cdots&0\\ 0&1-I_{R}^{2}&\cdots&0\\ \vdots&\vdots&\ddots&\vdots\\ 0&0&\cdots&1-I_{R}^{M}\end{array}\right).\]  
The permutation matrices \(T_{L}^{i}\) and \(T_{R}^{i}\) are the same for all internal nodes of computational domain (for \(i=1,\ldots,N-1\)).  
For the right boundary (for \(i=N\)), the representation of the vector of physical variables has the form  
\[\mathbf{U}_{N}=T_{L}^{N}\mathbf{W}_{N}+T_{R}^{N}\mathbf{R}. \tag{12}\]  
The permutation matrices \(T_{L}^{N}\) and \(T_{R}^{N}\) remain the same as at the internal nodes.  
The representation of vector of physical variables on the left boundary (at \(i=0\)) has a special form. To form the corresponding expression, several auxiliary matrix objects are introduced. Note that a square matrix having a single non-zero element equal to \(1\) in row \(l\) and in column \(k\), when multiplied by a column vector, moves the element of vector \(k\) to position \(l\). The representation of vector of physical variables at node \(i=0\) is related to the form of computational vector at \(i=1\). The structure of this relationship has the form  
\[\mathbf{U}_{0}=T_{L}^{0}\mathbf{L}+T_{R}^{0}\mathbf{W}_{1}. \tag{13}\]  
The first term on the right side is the set of components of vector of variables that are determined by the boundary values at the left end of the interval. The second term represents those vector components that are determined during the solution process. The left permutation matrix has the form  
\[T_{L}^{0}=E-\mathbf{I}_{L}E.\]  
The matrix \(T_{R}^{0}\) provides the substitution of those variables that are not included in the boundary conditions and therefore are in the vector \(\mathbf{W}_{1}\).  
To form the matrix \(T_{R}^{0}\), the vector \(\mathbf{W}_{1}\) is filled with those components of the vector \(\mathbf{U}_{1}\) for which right boundary conditions are not specified (these components are formed in the same way as in other vectors). As a result, \(M_{L}=M-M_{R}\) components are determined. To form the remaining \(M_{R}\) components, the first zero element \(l_{L}^{j}\) of the vector \(\mathbf{I}_{L}\) and the first non-zero element \(l_{R}^{k}\) of vector \(\mathbf{I}_{R}\) are found. The pair of indices \((j,k)\) determines the transition of an element from \(\mathbf{U}_{0}\) to \(\mathbf{W}_{1}\). Then, the next pair of indices is determined and the process is repeated. The constructed set of \(M_{R}\) pairs of indices allows to form a matrix \(T_{R}^{0}\), which contains units in places indicated by pairs of indices (the first number of the pair indicates the row, and the second number of the pair indicates the column). Its remaining elements are equal to zero. The described procedure allows to connect the physical and computational vectors at node \(i=0\) by a matrix relation.