<div dir="ltr">Dear Guys,<div><br></div><div>I have quick question for you. Can anyone tell me if MatDiagonalSet needs also MatAssemblyBegin/MatAssemblyEnd to be called afterwards or not?</div><div><br></div><div>Basically, I am trying to compute: sum (a_nb*\phi_nb), where anb are the off diagonal coeffs of the matrix and phi_nb the corresponding field values. </div><div><br></div><div>I was thinking to set the matrix diagonal to zero using MatDiagonalSet and then simply use MatMult(A, x) to accomplish my task. Do we have a better way in PETSc?  Any suggestion in welcome :)</div><div><br></div><div>Thank you very much</div></div>