Dear all, I am writing regarding the following problem: https://bitbucket.org/annakalog/buoy2d/src/3ee44ca3db164d8955d363b7d07f62238... I have previously defined a matrix-free operator as described in your documentation to solve a linear system, say A*u = b, where A=M+Q*Q^T. I now need to solve a similar system but in a mixed function space with two unknowns, i.e. A*u + B*v = b, B*u + C*v = 0. Here, matrices B, C have known forms that are similar to a mass matrix. The matrix A is the same as before. How would I solve the above linear system? Kind regards, Anna. -- Dr Anna Kalogirou Research Fellow School of Mathematics University of Leeds http://www1.maths.leeds.ac.uk/~matak/
Hi Anna,
On 20 May 2016, at 17:20, Anna Kalogirou <a.kalogirou@leeds.ac.uk> wrote:
Dear all,
I am writing regarding the following problem: https://bitbucket.org/annakalog/buoy2d/src/3ee44ca3db164d8955d363b7d07f62238...
I have previously defined a matrix-free operator as described in your documentation to solve a linear system, say A*u = b, where A=M+Q*Q^T.
I now need to solve a similar system but in a mixed function space with two unknowns, i.e. A*u + B*v = b, B*u + C*v = 0. Here, matrices B, C have known forms that are similar to a mass matrix. The matrix A is the same as before.
How would I solve the above linear system?
There are two parts to this. One, how do you create the operator: A B B C You can do this in the following manner using a MatNest object Let us assume that you have assembled B and C: B = assemble(B_form).M.handle C = assemble(C_form).M.handle A = MatrixFreeGuy() Now you can do: mixed_matrix = PETSc.Mat().createNest([[A, B], [B, C]]) and just use that in your KSP object as the operator. If you need to precondition this at all, you will need to think a bit about it. Given that you say B and C are basically mass matrices, in function space they are the identity. So you can do a Schur complement to eliminate C from the equations and the resulting operator will be approximately S = A + I Cheers, Lawrence
participants (2)
- 
                
                Anna Kalogirou
- 
                
                Lawrence Mitchell