<div dir="ltr"><div><div><div><div><div><div>Hi PETSc team:<br><br></div>I want to consult for a good way of doing an approximated Schur complement matrix. So I just want to handle a matrix in the format C + B^t B, or sometimes B^t B.<br><br></div>An easy way is to run with the MatCreateSchurComplement to create C + B^t inv A B, wherein A is an identity matrix. The downside is that the matrix free style does not allow for algebraic preconditioners.<br><br></div>Another way is to generate the matrix B^t B. For my case, I checked the sparsity of the resulting matrix from MatMatMult and it is pretty sparse still. I found a similar approach in <br><a href="http://www.mcs.anl.gov/petsc/petsc-current/src/snes/examples/tutorials/ex70.c.html">http://www.mcs.anl.gov/petsc/petsc-current/src/snes/examples/tutorials/ex70.c.html</a><br></div>where the B^t B matrix is created explicitly (<span style="color:rgb(0,0,255)">line 367-388</span>). However, there is a line of comment saying  " in real life this matrix would be build directly without MatMatMult". So I just want to ask the best way of assemblying and solving the B^t B matrix.<br><br></div>Thanks,<br><br></div>Luis <br></div>