I hope you are all enjoying a pleasant holiday season, if you happen to be celebrating.
Currently, I am engrossed in a university assignment that involves conducting a benchmark with various solvers such as Jacobi, Gauss-Seidel, and the Conjugate Gradient for solving the Poisson pressure equation.
Now, both the Jacobi and Gauss-Seidel Solvers can be employed in component form. This means you don't solve them as a matrix-vector product but rather with classical two nested loops, iterating through each component. If the domain is discretized as nxn, then the complexity of the component-form corresponds to O(n^2). In this form, the pressure field is expressed as a matrix.
On the flip side, the matrix-form necessitates a matrix-vector product (Au=f). In this setup, the pressure field is expressed as a vector, and the matrix A represents the discretized Laplacian operator, where I use FDM for simplicity reasons.
The challenge I'm currently grappling with is converting an already coded Lid Driven Cavity from component-form to matrix-form. The issue arises because when converting a pressure matrix-field (nxn) to a matrix-form, the matrix A becomes substantial (nxn, nxn) since the pressure vector field becomes of size nxn. Even though the matrix-vector product of Au=f is O(n^2), the sheer size of n in the matrix-form leads to a significant slowdown in my simulation.
So, for Navier-Stokes on FDM, particularly in the case of the Lid Driven Cavity, should one avoid the matrix-form for the solvers? If so, how can the Conjugate Gradient compete with the component form? The challenge lies in the fact that the Conjugate Gradient cannot be used in component-form since its nature resides in vectors (Krylov spaces).
In conclusion, I suspect there might be a critical aspect I've overlooked, and any guidance or insights would be greatly appreciated.