Hello, I would like to do the following matrix-vector operation in PETSc: h += (Diag(A) - A) * u where A is a matrix, Diag(A) is a matrix and h, u are vectors. It is the multiplication of a matrix with diagonals set to zero with a vector. How can I do this in PETSc? because MatGetDiagonal gives a vector not a matrix. Billy.