[petsc-users] Create SIMPLE pc for Schur explicitly

John johnlucassaturday at gmail.com
Tue Mar 6 16:09:04 CST 2018


Hi PETSc team:

I am trying to create a SIMPLE type approximation for the Schur complement.
It is a nonlinear code, so I have to update the Schur matrix once the
tangent jacobian is updated. I am trying to figure out the best way of
doing that.

In terms of generating an algebraic form of Schur S, I am trying to do the
following.

// S = A10 x A01, I have performed a diagonal scaling on all matrices, so
the diag(A00) = I.
MatMatMult(A10, A01, MAT_INITIAL_MATRIX, S);
MatScale(S, -1.0); // S = -1 x S
MatAXPY(S, 1.0, A11, S, DIFFERENT_NONZERO_PATTERN); // S = A11 + S

My questions are:
(1) When I update the Schur complement, do I need to call
MatDestroy(&S);
MatMatMult(A10, A01, MAT_INITIAL_MATRIX, S);
or shall I just call
MatMatMult(A10, A01, MAT_REUSE_MATRIX, S);

Basically, I am not sure how to properly use the flag MAT_REUSE_MATRIX.

(2) When I update the Schur complement, the initial call of MatAXPY already
incorporated the contribution of A00 in terms of nonzero patterns. So in my
second call of MatAXPY, shall I use the flag SUBSET_NONZERO_PATTERN?

Best regards,

John
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20180306/b8a84c24/attachment.html>


More information about the petsc-users mailing list