-
Notifications
You must be signed in to change notification settings - Fork 95
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom preconditioner implemantation approach? #95
Comments
Hello, Good luck with your developments. |
No hurry. I think, the current use of the term "identity" in RapidCFD sources refers in some cases to the identity of something like a processor number or to https://en.wikipedia.org/wiki/Identity_transform but not to operations involving the Identity Matrix. |
Thanks for the clarification. I am not sure I know how to help you with this matter offhand. Sorry about that. |
What's needed to compute "M = (I-LD^-1)(I-D^-1L^T)". Let's look at it step-by-step: The basis could be diagonalPreconditioner.C / diagonalPreconditioner.H and as we look at symmetric matrices, only wA preconditioning will be needed. 1: The Identity Matrix of size "sol.matrix().diag().size()" needs to be created which is a diagonal matrix with ones only: const scalargpuField& IdentityMatrix = ??? 2: D^-1 is and should be stored temporarily as it's used twice:
Unfortunately, I can't find operations supporting the following operations - maybe someone has an idea about how to approach these operations 3-6?: 3: Matrix * Matrix multiplication: Compute LD^-1 4: Transpose of a matrix (probably not needed if we can use U): Compute D^-1L^T where L^T is the transpose of L which should be "U" i.e. upper in OpenFOAM terms, I think 5: Subtraction of the Identity Matrix - Matrix: Compute the subtraction operations I-LD^-1 and I-D^-1L^T 6: Another matrix * matrix multiplication like in step 4 to complete the preconditioner 7: Apply the preconditioner i.e. compute wA, according to the diagonal preconditioner example The AINV of RapidCFD is of no help as it uses Jacobi = diagonal preconditioning as the main building block according to the paper and from what I understand from the code. |
I probably can't get to thinking about your message in detail for a while because I am on holiday and I don't have the firsthand experience on this matter to reply quickly. Sorry about that. |
I haven't forgotten about your question, but I do not know the answer. Perhaps you need to create functors to accomplish the required matrix operations? Do the matrix operations in lduMatrixSolverFunctors.H help? Sorry I do not have a more direct answer to your question. I ported PBiCGStab to RapidCFD some years ago, but I am not sure this work will be helpful to you. Perhaps there are others reading about this issue who can help. |
Yes, I think some functors need to be created or adapted. My problem is, that I need matrix x matrix operations instead of matrix x vector operations and those appear only in the AINV preconditioner implementation. In the paper which is the basis for the AINV implementation in RapidCFD with the title "Algorithm for Sparse Approximate Inverse Preconditioners in the Conjugate Gradient Method" by Ilya B. Labutin and Irina V. Surodina, they describe and tested three implementations with different orders of approximations of the inverse to be used as preconditioner i.e. 1, 3, 7 orders using Jacobi as an initial approximation for the inverse to calculate D1 = J + J(I − AJ) where D1 is the first order approximation of the inverse of A which serves as preconditioner in one case. There is a normalMult operation in the AINV implementation but I don't understand the code. I assume that's the matrix x matrix operation I am looking for. |
I'd like to implement an additional preconditioner for SPD/symmetric matrices i.e. to solve the pressure equation:
There are several candidates but they have many similarities from an computational perspective.
How can i implement linear algebra matrix operations involving the Identity Matrix (I) e.g. M = (I-LD^-1)(I-D^-1L^T) where D^-1 can be computed as in the diagonal preconditioner and L^T represents the transpose of L (should be U in OpenFOAM terms)?
The text was updated successfully, but these errors were encountered: