Explicit representation of Schur complement in PCFIELDSPLIT
In bifurcation analysis, we are often faced with “augmented” block matrix systems, where we have a matrix of the form:
A = [[A00, A01], [A10', A11]];
With A00 a large sparse nxn matrix, A10 and A01 dense “tall and skinny” matrices (nxm with m<<n, usually m <= 10), and A11 a dense mxm matrix.
When using PETSc to solve such block systems, we have typically used PCFIELDSPLIT with
-pc_fieldsplit_schur_precondition self
. However, since the Schur complement is never built explicitly, we must perform a solve every time we need to evaluate the Schur complement matrix S = A11 - A10’*inv(A00)*A01. For such systems, a much better approach would be to build S explicitly. However, we cannot find a way to do this in PETSc outside of implementing the process “by hand” using a shell preconditioner. By doing so, we do achieve the desired performance, but at the cost of a less readable and less intuitive code.
Another option is to use -pc_fieldsplit_schur_fact_type full
, but this only gets us halfway there. The problem is that whenever you do a solve with the Schur complement, you do inner A00 solves (by the definition of S). This is kind of wasteful in the case where S is assembled explicitly (the Pmat is the explicitly assembled S, but the Amat remains as the implicit representation of S involving A00 solves).
Could a new option be added in PCFIELDSPLIT to use the explicit Mat as both the Pmat and the Amat?