OpenFOAM Preconditioners
Hello All,
I am curious as to how the diagonal preconditioners work in openfoam. I know that a DIC preconditioner is a Simplified diagonal-based incomplete Cholesky preconditioner for symmetric matrices. I know that the diagonal is saved for later use, but is it just a diagonal matrix preconditioner? what is a good source covering these simplified diagonal preconditioners? Dan |
I think it would also be helpful if someone could shed some light on all the preconditioners in OF, how they work, their applications, etc.
OF only lists them, no description on any advantages or how they differ. https://openfoam.com/documentation/u...fvSolution.php |
Is there a paper or other documentation describing the "Simplified Diagonal-based Incomplete Cholesky preconditioner = DIC" implemented in OpenFOAM?
|
You will always find the answer while checking the source code. Okay, c++ implementation is something different than the mathematics in general but if you go through the code, you will be able to figure out how it works.
|
Below is a list of references on the incomplete Cholesky factorization preconditioner.
In case that reverse engineering of the code results in good documentation, I will be happy to give that documentation a look. Thanks, Domenico. Original reference on IC preconditioner [1] @article{meijerink1977iterative, title={An iterative solution method for linear systems of which the coefficient matrix is a symmetric 𝑀-matrix}, author={Meijerink, J and Van Der Vorst, Henk A}, journal={Mathematics of computation}, volume={31}, number={137}, pages={148--162}, year={1977} } Modified IC preconditioner @article{gustafsson1978class, title={A class of first order factorization methods}, author={Gustafsson, Ivar}, journal={BIT Numerical Mathematics}, volume={18}, number={2}, pages={142--156}, year={1978}, publisher={Springer} } Relaxed IC preconditioner @article{axelsson1986eigenvalue, title={On the eigenvalue distribution of a class of preconditioning methods}, author={Axelsson, Owe and Lindskog, Gunhild}, journal={Numerische Mathematik}, volume={48}, number={5}, pages={479--498}, year={1986}, publisher={Springer} } Discussion on diagonal enties @article{kershaw1978incomplete, title={The incomplete Cholesky—conjugate gradient method for the iterative solution of systems of linear equations}, author={Kershaw, David S}, journal={Journal of computational physics}, volume={26}, number={1}, pages={43--65}, year={1978}, publisher={Elsevier} } |
Let's get started, for those who want to join in:
DIC is a "Simplified Diagonal-based Incomplete Cholesky preconditioner." What are the simplifications compared to Incomplete Cholesky? Code:
|
Wonderful to have lift-off on this discussion ;-)
Below is how I understand the code shared by Klaus. In a next iteration we need to identify where exactly in src/OpenFoam the incomplete Cholesky factors are computed. This factorization in not include in the previous iteration by Klaus. It is unclear to me to what extend this code depends on the version of OpenFoam. I Construction of the preconditioner %..Stage (1/3): initialize reverse diagonal to diagonal A %..this occurs in the constructor of the preconditioner for i = 1:n rD[i] = A[i,i] end %..Stage (2/3): modify the diagonal %..this occurs in the loop over all faces %..for each faces, owner (lPtr) and neighbor (uPtr) are identified %..in a 2-by-2 grid, only entries 2, 3 and 4 are updated %..unclear to Domenico in current iteration why only uPtr entries are modified %..Observe that A is symmetric, thus A[i,j] = A[j,i] for i = 1:n for j = i+1:n %..upper triangular part only rD[j] = rD[j] - A[i,j]*A[i,j]/rD[i]; end end %..Stage (3/3): reverse the diagonal for i = 1:n rD[i] = 1/rD[i] end II Application of the preconditioner: the preconditoner is applied to the residual in three stages %..Stage (1/3): apply the diagonal part of the preconditioner to the residual vector %..Stage (2/3): apply the lower triangular part of the preconditioner to the residual vector %..Stage (3/3): apply the upper trt part of the preconditioner to the residual vector |
Just for reference. I do have the book "Numerical Precipices" that include code explanation actually and you can simply take it and use it. The algorithms mentioned here should be included in the book too (has around 1000 pages).
|
I had another look at it and compared DIC with FDIC in which factors are calculated differently. Differences, see comments in the DIC code section below:
Code:
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // |
Quote:
I am wondering why the implementation of the application of the preconditioner differs e.g. between FDIC and DIC? Isn't the application of the preconditioner simply a matrix (the preconditioner) x vector (residual = wA) multiplication where the matrix is split into a lower, diagonal and upper part due to the LDU storage format used within OpenFOAM hence we have to apply those three parts in three steps but why differ the algorithms? Code:
FDIC: Code:
DIC: |
All times are GMT -4. The time now is 21:14. |